public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/29612]  New: gcc --save-temps does not give "multi-character character constant" error
@ 2006-10-27  4:40 ian at airs dot com
  2006-10-27  4:46 ` [Bug preprocessor/29612] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ian at airs dot com @ 2006-10-27  4:40 UTC (permalink / raw)
  To: gcc-bugs

When I compile this simple C file:

#include <stddef.h>
int main() {
  return '\1\2';
}

I get a warning:

foo.c:3:10: warning: multi-character character constant

When I compile the same file using --save-temps, I do not get a warning. 
Similarly, if I use -E to produce a preprocessed file, and compile that, I do
not get a warning.  This is a bug: options like --save-temps and -E should not
affect the set of warnings which are issued.

However ,I noticed that I do get a warning if I compile with --save-temps
-Wsystem-headers.

This appears to be a bug in libcpp: when a line directive indicates that it is
entering a system header file, it records the current state.  However, it
apparently does not restore the old state when it exits the system header file.
 The effect is that preprocessor warnings and errors are suppressed in a .i
file if a system header file is included.


-- 
           Summary: gcc --save-temps does not give "multi-character
                    character constant" error
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ian at airs dot com


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-02-03 20:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-27  4:40 [Bug preprocessor/29612] New: gcc --save-temps does not give "multi-character character constant" error ian at airs dot com
2006-10-27  4:46 ` [Bug preprocessor/29612] " pinskia at gcc dot gnu dot org
2006-10-27  4:47 ` [Bug preprocessor/29612] [4.0/4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2006-11-08 11:02 ` jakub at gcc dot gnu dot org
2006-11-13  3:38 ` mmitchel at gcc dot gnu dot org
2006-12-29  8:15 ` jakub at gcc dot gnu dot org
2006-12-29  8:16 ` jakub at gcc dot gnu dot org
2006-12-29  8:18 ` jakub at gcc dot gnu dot org
2006-12-29  8:25 ` [Bug preprocessor/29612] [4.0 " jakub at gcc dot gnu dot org
2007-02-03 20:45 ` gdr at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).