public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60014] New: Bad warning suppression
@ 2014-01-31 21:27 megahallon at gmail dot com
  2014-06-10  6:30 ` [Bug preprocessor/60014] Bad warning suppression caused by track-macro-expansion when not using integrated cpp peff at peff dot net
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: megahallon at gmail dot com @ 2014-01-31 21:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60014
           Summary: Bad warning suppression
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: megahallon at gmail dot com

Using gcc 4.8.2:

/tmp/foo/foo.h:
-------------------------------
#define FOO(a, b) __LINE__;
-------------------------------

bug.c:
-------------------------------
#include "foo.h"

int main()
{
  FOO(1, 
      0);
  char* a = 1;
}
-------------------------------

$ /usr/bin/gcc bug.c -isystem /tmp/foo -no-integrated-cpp

should give a warning on line 7 but it not seen.

These works:

$ /usr/bin/gcc bug.c -isystem /tmp/foo -no-integrated-cpp
-ftrack-macro-expansion=0
$ /usr/bin/gcc bug.c -I /tmp/foo -no-integrated-cpp
$ /usr/bin/gcc bug.c -isystem /tmp/foo

-save-temps gives the same results as -no-integrated-cpp.

Output from -save-temps:

bug.i
-----------------------------
void main()
{

 6
# 5 "bug.c" 3 4
  ;
        ;
  char *a = 1;
}
-----------------------------

The suppress flag in the line directive apparently affects line 7 which is not
as expected.

In practice this means that ccache and similar systems that compiles
preprocessed output may fail to show warnings that are seen when compiling
normally.


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

end of thread, other threads:[~2022-10-12 22:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-31 21:27 [Bug c/60014] New: Bad warning suppression megahallon at gmail dot com
2014-06-10  6:30 ` [Bug preprocessor/60014] Bad warning suppression caused by track-macro-expansion when not using integrated cpp peff at peff dot net
2014-06-10 10:24 ` manu at gcc dot gnu.org
2015-04-28 19:47 ` megahallon at gmail dot com
2022-10-06 21:51 ` lhyatt at gcc dot gnu.org
2022-10-12 22:16 ` cvs-commit at gcc dot gnu.org
2022-10-12 22:17 ` lhyatt at gcc dot gnu.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).