public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/28165]  New: _Pragma GCC system_header broken
@ 2006-06-26  2:38 sabre at nondot dot org
  2006-12-29  3:28 ` [Bug preprocessor/28165] " tromey at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: sabre at nondot dot org @ 2006-06-26  2:38 UTC (permalink / raw)
  To: gcc-bugs

In a main translation unit, this:

#pragma GCC system_header

results in this warning:
warning: #pragma system_header ignored outside include file

However, this doesn't:
_Pragma ("GCC system_header")

In fact, this causes GCC to emit a line marker switching the main translation
unit to look like a system header.

-Chris


-- 
           Summary: _Pragma GCC system_header broken
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sabre at nondot dot org


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


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

* [Bug preprocessor/28165] _Pragma GCC system_header broken
  2006-06-26  2:38 [Bug preprocessor/28165] New: _Pragma GCC system_header broken sabre at nondot dot org
@ 2006-12-29  3:28 ` tromey at gcc dot gnu dot org
  2006-12-29  4:29 ` tromey at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-12-29  3:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tromey at gcc dot gnu dot org  2006-12-29 03:28 -------
This happens because destringize_and_run calls cpp_push_buffer.
The new buffer has a non-null 'prev'; do_pragma_system_header
checks for prev==NULL to determine whether the directive is
in the primary source file.

I'm testing a patch for this.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-12-29 03:28:29
               date|                            |


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


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

* [Bug preprocessor/28165] _Pragma GCC system_header broken
  2006-06-26  2:38 [Bug preprocessor/28165] New: _Pragma GCC system_header broken sabre at nondot dot org
  2006-12-29  3:28 ` [Bug preprocessor/28165] " tromey at gcc dot gnu dot org
@ 2006-12-29  4:29 ` tromey at gcc dot gnu dot org
  2007-01-01 21:56 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-12-29  4:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tromey at gcc dot gnu dot org  2006-12-29 04:29 -------
I think this will also occur for _Pragma("once")


-- 


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


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

* [Bug preprocessor/28165] _Pragma GCC system_header broken
  2006-06-26  2:38 [Bug preprocessor/28165] New: _Pragma GCC system_header broken sabre at nondot dot org
  2006-12-29  3:28 ` [Bug preprocessor/28165] " tromey at gcc dot gnu dot org
  2006-12-29  4:29 ` tromey at gcc dot gnu dot org
@ 2007-01-01 21:56 ` patchapp at dberlin dot org
  2007-01-04 15:33 ` tromey at gcc dot gnu dot org
  2007-01-04 15:33 ` tromey at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: patchapp at dberlin dot org @ 2007-01-01 21:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from patchapp at dberlin dot org  2007-01-01 21:56 -------
Subject: Bug number PR preprocessor/28165

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01850.html


-- 


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


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

* [Bug preprocessor/28165] _Pragma GCC system_header broken
  2006-06-26  2:38 [Bug preprocessor/28165] New: _Pragma GCC system_header broken sabre at nondot dot org
                   ` (2 preceding siblings ...)
  2007-01-01 21:56 ` patchapp at dberlin dot org
@ 2007-01-04 15:33 ` tromey at gcc dot gnu dot org
  2007-01-04 15:33 ` tromey at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-01-04 15:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tromey at gcc dot gnu dot org  2007-01-04 15:32 -------
Subject: Bug 28165

Author: tromey
Date: Thu Jan  4 15:32:26 2007
New Revision: 120441

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120441
Log:
libcpp
        PR preprocessor/28165:
        * internal.h (cpp_in_primary_file): New function.
        * directives.c (do_include_next): Use cpp_in_primary_file.
        (do_pragma_once): Likewise.
        (do_pragma_system_header): Likewise.
gcc/testsuite
        PR preprocessor/28165:
        * gcc.dg/cpp/pr28165.c: New file.

Added:
    trunk/gcc/testsuite/gcc.dg/cpp/pr28165.c
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/libcpp/ChangeLog
    trunk/libcpp/directives.c
    trunk/libcpp/internal.h


-- 


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


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

* [Bug preprocessor/28165] _Pragma GCC system_header broken
  2006-06-26  2:38 [Bug preprocessor/28165] New: _Pragma GCC system_header broken sabre at nondot dot org
                   ` (3 preceding siblings ...)
  2007-01-04 15:33 ` tromey at gcc dot gnu dot org
@ 2007-01-04 15:33 ` tromey at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-01-04 15:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tromey at gcc dot gnu dot org  2007-01-04 15:33 -------
I checked in a fix for this.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

end of thread, other threads:[~2007-01-04 15:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-26  2:38 [Bug preprocessor/28165] New: _Pragma GCC system_header broken sabre at nondot dot org
2006-12-29  3:28 ` [Bug preprocessor/28165] " tromey at gcc dot gnu dot org
2006-12-29  4:29 ` tromey at gcc dot gnu dot org
2007-01-01 21:56 ` patchapp at dberlin dot org
2007-01-04 15:33 ` tromey at gcc dot gnu dot org
2007-01-04 15:33 ` tromey 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).