This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug preprocessor/60014] Bad warning suppression caused by track-macro-expansion when not using integrated cpp


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

Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-06-10
                 CC|                            |dodji at gcc dot gnu.org,
                   |                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
I can reproduce it in trunk using:

#pragma GCC system_header
#define FOO(a, b) __LINE__;

I think the problem is that there is a push of the system-header-ness flag on
the expansion of the macro, but there is no pop to restore
non-system-header-ness.

That is, we generate:

# 1 "test.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.c"
# 1 "test.h" 1

# 2 "test.h" 3
# 2 "test.c" 2

int main()
{

 6
# 5 "test.c" 3
  ;
        ;
  char* a = 1;
}

but we should generate:

# 1 "test.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.c"
# 1 "test.h" 1

# 2 "test.h" 3
# 2 "test.c" 2

int main()
{

 6
# 5 "test.c" 3
  ;
# 6 "test.c"
        ;
  char* a = 1;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]