X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fliboconfig%2Fscanner.l;h=41d66438dd86e1176621034734d4666a29e0d773;hb=88ad924df0622911c555cea6826933732e91d9cd;hp=08524fd84a4a775dd778c9eb1d873f7935739d11;hpb=09c6a320f3cb36b5dbb2c2ce43858f33be7acf9b;p=collectd.git diff --git a/src/liboconfig/scanner.l b/src/liboconfig/scanner.l index 08524fd8..48580031 100644 --- a/src/liboconfig/scanner.l +++ b/src/liboconfig/scanner.l @@ -27,17 +27,18 @@ */ %{ -/* 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 +#include #include "oconfig.h" #include "aux_types.h" #include "parser.h" +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-noreturn" +#endif + + /* multiline string buffer */ static char *ml_buffer = NULL; static int ml_pos = 0; @@ -56,6 +57,8 @@ static void ml_append (char *); %} %option yylineno %option noyywrap +%option noinput +%option nounput %x ML WHITE_SPACE [\ \t\b] NON_WHITE_SPACE [^\ \t\b] @@ -149,7 +152,7 @@ static void ml_append (char *string) if (ml_free <= len) { ml_len += len - ml_free + 1; - ml_buffer = (char *)realloc (ml_buffer, ml_len); + ml_buffer = realloc (ml_buffer, ml_len); if (NULL == ml_buffer) YY_FATAL_ERROR ("out of dynamic memory in ml_append"); } @@ -162,3 +165,6 @@ static void ml_append (char *string) return; } /* ml_append */ +#ifdef __clang__ +#pragma clang diagnostic pop +#endif