liboconfig: Disable some clang warnings.
authorFlorian Forster <octo@collectd.org>
Tue, 16 Jun 2015 21:07:34 +0000 (23:07 +0200)
committerFlorian Forster <octo@collectd.org>
Tue, 16 Jun 2015 21:07:34 +0000 (23:07 +0200)
Hopefully fixes:

scanner.c:4128:17: error: unused function 'yyunput' [-Werror,-Wunused-function]
    static void yyunput (int c, register char * yy_bp )
                ^
scanner.c:4173:16: error: function 'input' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
    static int input  (void)
               ^
2 errors generated.

src/liboconfig/scanner.l

index 9f0cd8e..6294ae5 100644 (file)
  */
 
 %{
+/* lex and yacc do some weird stuff, so turn off some warnings. */
+#if defined(__clang__)
+# pragma clang diagnostic ignored "-Wunused-function"
+# pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
+#endif
+
 #include <stdlib.h>
 #include "oconfig.h"
 #include "aux_types.h"