mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
build: drop unused variable from "C99 snprintf" meson check
Otherwise, `CFLAGS='-Wall -Werror' meson build` fails detection with: Running compile: ... int main(void) { doit(); exit(1); } ----------- Command line: `cc /data/src/glib/build/meson-private/tmp7n5yqh0h/testfile.c -o /data/src/glib/build/meson-private/tmp7n5yqh0h/output.exe -Werror -Wall -D_FILE_OFFSET_BITS=64 -O0 -std=gnu99` -> 1 stderr: /data/src/glib/build/meson-private/tmp7n5yqh0h/testfile.c: In function 'doit': /data/src/glib/build/meson-private/tmp7n5yqh0h/testfile.c:10:11: error: unused variable 'args' [-Werror=unused-variable] 10 | va_list args; | ^~~~ /data/src/glib/build/meson-private/tmp7n5yqh0h/testfile.c:13:33: error: '1234567' directive output truncated writing 7 bytes into a region of size 5 [-Werror=format-truncation=] 13 | r = snprintf(buffer, 5, "1234567"); | ~~~~~^~ /data/src/glib/build/meson-private/tmp7n5yqh0h/testfile.c:13:7: note: 'snprintf' output 8 bytes into a destination of size 5 13 | r = snprintf(buffer, 5, "1234567"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ----------- Could not compile test file /data/src/glib/build/meson-private/tmp7n5yqh0h/testfile.c: 1 Checking if "C99 snprintf" runs: DID NOT COMPILE
This commit is contained in:
parent
5525672a5f
commit
d0afd2b783
@ -1223,7 +1223,6 @@ int
|
||||
doit()
|
||||
{
|
||||
char buffer[32];
|
||||
va_list args;
|
||||
int r;
|
||||
|
||||
r = snprintf(buffer, 5, "1234567");
|
||||
|
Loading…
Reference in New Issue
Block a user