[Bug c/38769] New: Sometimes a percent sign is just a percent sign

2009-01-08 Thread jesnow at uh dot edu
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



[Bug c/38769] Sometimes a percent sign is just a percent sign

2009-01-08 Thread jesnow at uh dot edu


--- Comment #2 from jesnow at uh dot edu  2009-01-08 20:58 ---
Subject: Re:  Sometimes a percent sign is just a percent sign

Sorry my mistake.

jakub at gcc dot gnu dot org wrote:
> --- Comment #1 from jakub at gcc dot gnu dot org  2009-01-08 20:54 ---
> What kind of escaping are you talking about?
> "\%" is the same as "%" in gcc.  If you want to print character %%, you should
> write printf ("something %%\n");
> 
> 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38769