This removes the following compiler warnings which were particularly problematic
as they were pointing to the wrong source lines. It is unclear whether this is
due to a Flex bug or the way we are calling Flex.
../../lib/cgraph/scan.l: In function ‘storeFileName’:
../../lib/cgraph/scan.l:98:28: warning: conversion to ‘size_t’ {aka ‘long
unsigned int’} from ‘int’ may change the sign of the result
[-Wsign-conversion]
98 | static char* buf;
| ^
../../lib/cgraph/scan.l:98:37: warning: conversion to ‘size_t’ {aka ‘long
unsigned int’} from ‘int’ may change the sign of the result
[-Wsign-conversion]
98 | static char* buf;
| ^
../../lib/cgraph/scan.l: In function ‘ppDirective’:
../../lib/cgraph/scan.l:125:29: warning: conversion from ‘long int’ to ‘int’
may change value [-Wconversion]
125 | while (*e && *e != '"') e++;
| ~^~
aaglval.str = agstrdup_html(Ag_G_global, agxbuse(&Sbuf));
}
-static void
-storeFileName (char* fname, int len)
-{
- static int cnt;
+static void storeFileName(char* fname, size_t len) {
+ static size_t cnt;
static char* buf;
if (len > cnt) {
while (*e && *e != '"') e++;
if (e != p && *e == '"') {
*e = '\0';
- storeFileName (p, e-p);
+ storeFileName(p, (size_t)(e - p));
}
}
}