Consider the following code:
#include
main()
{
printf("hello, world%\n");
printf("hello, world\%\n");
}
The first generates a warning with -Wall:
percent.c:6: warning: unknown conversion type character 0xa in format
But the second is escaped, and should not. But does anyway.
This reduces the usefulness of having warnings turned on at all, as a lot of
spurious warnings are generated if you do much statistics in your code. Any
character after any non-format string percent sign will trigger this warning,
escaped or not.
--
Summary: Sometimes a percent sign is just a percent sign
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jesnow at uh dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38769