You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compilation of r.fill.stats complains about "argument 1 null where non-null expected" with -Wnonnull and -Wformat-overflow for an sprintf call in calculate_raster_mode.
To reproduce
Run compilation in the nix develop environment or with -Wformat-overflow= and/or -Wnonnull (using GCC v13?).
Expected behavior
No errors or warnings. Possibly warnings treated as errors in Nix build.
Screenshots
VERSION_NUMBER=8.5.0dev /home/vpetras/Projects/grass/code/grass/dist.x86_64-pc-linux-gnu/utils/g.html2man.py "/home/vpetras/Projects/grass/code/grass/dist.x86_64-pc-linux-gnu/docs/html/r.fill.stats.html" "/home/vpetras/Projects/grass/code/grass/dist.x86_64-pc-linux-gnu/docs/man/man1/r.fill.stats.1"
In file included from /nix/store/wlavaybjbzgllhq11lib6qgr7rm8imgp-glibc-2.39-52-dev/include/stdio.h:980,
from main.c:38:
In function 'sprintf',
inlined from 'calculate_raster_mode' at main.c:1164:9:
/nix/store/wlavaybjbzgllhq11lib6qgr7rm8imgp-glibc-2.39-52-dev/include/bits/stdio2.h:30:10: warning: argument 1 null where non-null expected [-Wnonnull]
30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
/nix/store/wlavaybjbzgllhq11lib6qgr7rm8imgp-glibc-2.39-52-dev/include/bits/stdio2.h:30:10: note: in a call to built-in function '__builtin_sprintf'
/nix/store/wlavaybjbzgllhq11lib6qgr7rm8imgp-glibc-2.39-52-dev/include/bits/stdio2.h:30:10: warning: null destination pointer [-Wformat-overflow=]
rm r.fill.stats.tmp.html
make[4]: Leaving directory '/home/vpetras/Projects/grass/code/grass/raster/r.fill.stats'
Describe the bug
Compilation of r.fill.stats complains about "argument 1 null where non-null expected" with
-Wnonnull
and-Wformat-overflow
for an sprintf call in calculate_raster_mode.To reproduce
Run compilation in the
nix develop
environment or with-Wformat-overflow=
and/or-Wnonnull
(using GCC v13?).Expected behavior
No errors or warnings. Possibly warnings treated as errors in Nix build.
Screenshots
System description
nix develop
environment on Ubuntu 22.04.Additional context
The text was updated successfully, but these errors were encountered: