X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fliboconfig%2Fscanner.l;h=a9c733e3af3d02315f19c18bce6b0b96e732596c;hb=0261b776d7300048bfc95be6f808e98fbe896f76;hp=41d66438dd86e1176621034734d4666a29e0d773;hpb=092e0c8763ef268918fb8117be9579d375ac8cfc;p=collectd.git diff --git a/src/liboconfig/scanner.l b/src/liboconfig/scanner.l index 41d66438..a9c733e3 100644 --- a/src/liboconfig/scanner.l +++ b/src/liboconfig/scanner.l @@ -33,6 +33,12 @@ #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; @@ -104,7 +110,7 @@ IPV6_ADDR ({IPV6_BASE})|(\[{IPV6_BASE}\](:{PORT})?) {UNQUOTED_STRING} {yylval.string = yytext; return (UNQUOTED_STRING);} \"{QUOTED_STRING}\\{EOL} { - int len = strlen (yytext); + size_t len = strlen (yytext); ml_pos = 0; @@ -120,7 +126,7 @@ IPV6_ADDR ({IPV6_BASE})|(\[{IPV6_BASE}\](:{PORT})?) } ^{WHITE_SPACE}+ {/* remove leading white-space */} {NON_WHITE_SPACE}{QUOTED_STRING}\\{EOL} { - int len = strlen (yytext); + size_t len = strlen (yytext); /* remove "\\" */ if ('\r' == yytext[len - 2]) @@ -141,12 +147,12 @@ IPV6_ADDR ({IPV6_BASE})|(\[{IPV6_BASE}\](:{PORT})?) %% static void ml_append (char *string) { - int len = strlen (string); + size_t len = strlen (string); int s; 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"); } @@ -159,3 +165,6 @@ static void ml_append (char *string) return; } /* ml_append */ +#ifdef __clang__ +#pragma clang diagnostic pop +#endif