re: current gcc 12.4.0 bug
matthew green <[email protected]> Sat, 28 Sep 2024 13:24:39 +1000
| Newsgroups | gmane.os.netbsd.devel.toolchain |
|---|---|
| Message-ID | <[email protected]> |
[email protected] writes: > I'm running current and stumbled on that: > > exec.c: In function 'shellexec': > exec.c:145:46: error: '%s' directive argument is null > [-Werror=format-overflow=] > 145 | (void)fprintf(stderr, "do_qfilename (%s): %d\n", > | ^~ > cc1: all warnings being treated as errors > > While the argument is not NULL. > > It's a bug in gcc see: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90036 > > With this around, how can we be sure that the generated code is > correct? looks like it's been a bug since GCC 8, and that the problem is a *missing* optimisation, so, i'd just go with ignoring it either with a -Wno- or going with "assert(foo)" before the fprintf(), as recommended in the above PR. i can't get any of the examples in the PR to fail for me though, with GCC 10 or GCC 12 (both pkgsrc or gcc native.) .mrg.