X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fliboconfig%2Fscanner.l;h=be6d67827b576df4d59e42cbe1db3158e8be9e8f;hb=f96dc61ae9a30e70d4007e496662c2a7188e48f7;hp=7a831c2a8f63390e8435adca419867c1a5604fc9;hpb=12f249b209d7fa31e3a9d53315e47a2342463e0f;p=collectd.git diff --git a/src/liboconfig/scanner.l b/src/liboconfig/scanner.l index 7a831c2a..be6d6782 100644 --- a/src/liboconfig/scanner.l +++ b/src/liboconfig/scanner.l @@ -33,10 +33,16 @@ #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; -static int ml_len = 0; +static size_t ml_pos = 0; +static size_t ml_len = 0; #define ml_free (ml_len - ml_pos) @@ -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,7 +147,7 @@ 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) { @@ -159,3 +165,6 @@ static void ml_append (char *string) return; } /* ml_append */ +#ifdef __clang__ +#pragma clang diagnostic pop +#endif