public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "megahallon at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/60014] New: Bad warning suppression
Date: Fri, 31 Jan 2014 21:27:00 -0000	[thread overview]
Message-ID: <bug-60014-4@http.gcc.gnu.org/bugzilla/> (raw)

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.


             reply	other threads:[~2014-01-31 21:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31 21:27 megahallon at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-60014-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).