| Summary: | Fix "format not a string literal" errors | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Bastien Nocera <bugzilla> |
| Component: | build | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | amaranth72, bugzilla, philipp.wiesemann |
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
Fix "format not a string literal" errors
Fix "format not a string literal" errors |
||
|
Description
Bastien Nocera
2016-06-23 15:17:51 UTC
Created attachment 2514 [details]
Fix "format not a string literal" errors
With GCC 6.1.
it seems better to me to change the code so the warnings don't happen in the first place, rather than making gcc ignore the warnings. This is the "low impact, went through on my machine". I can look at reducing the work-arounds is that's what it would take. I'm pretty sure that we won't be able to fix all of them without external API changes though. Not sure that's what you'd want. Some of the warnings should have been fixed here: http://hg.libsdl.org/SDL/rev/8eeab279c545 The warnings also showed up if the string constants were modified to static. As the strings were just passed around and never modified locally, these warnings actually seemed to be mostly false positives. Created attachment 2517 [details]
Fix "format not a string literal" errors
With GCC 6.1.
I don't think there's a way to fix the remaining warnings without working around them as done in the patch. The warning in "SDL_test_log.c" might be fixed by inlining the format string. But this creates new warning with "-Wformat-y2k" which might lead to the same failure in the end. Fixed, thanks! https://hg.libsdl.org/SDL/rev/fa4e35434a9c |