public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
       [not found] <bug-22168-638@http.gcc.gnu.org/bugzilla/>
@ 2006-12-29  2:54 ` tromey at gcc dot gnu dot org
  2007-01-01 21:57 ` patchapp at dberlin dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-12-29  2:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from tromey at gcc dot gnu dot org  2006-12-29 02:54 -------
I am testing a patch for this.

It pedwarns on '#foo' in an expression, and also when #assert or
#unassert is used.  It also warns about these when -Wdeprecated
is given.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org


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


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

* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
       [not found] <bug-22168-638@http.gcc.gnu.org/bugzilla/>
  2006-12-29  2:54 ` [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode tromey at gcc dot gnu dot org
@ 2007-01-01 21:57 ` patchapp at dberlin dot org
  2007-01-08  1:33 ` tromey at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: patchapp at dberlin dot org @ 2007-01-01 21:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from patchapp at dberlin dot org  2007-01-01 21:57 -------
Subject: Bug number PR preprocessor/22168

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/msg01853.html


-- 


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


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

* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
       [not found] <bug-22168-638@http.gcc.gnu.org/bugzilla/>
  2006-12-29  2:54 ` [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode tromey at gcc dot gnu dot org
  2007-01-01 21:57 ` patchapp at dberlin dot org
@ 2007-01-08  1:33 ` tromey at gcc dot gnu dot org
  2007-05-21  8:54 ` manu at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-01-08  1:33 UTC (permalink / raw)
  To: gcc-bugs



-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tromey at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-01-21 03:03:43         |2007-01-08 01:32:48
               date|                            |


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


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

* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
       [not found] <bug-22168-638@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2007-01-08  1:33 ` tromey at gcc dot gnu dot org
@ 2007-05-21  8:54 ` manu at gcc dot gnu dot org
  2008-02-26 20:49 ` tromey at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-05-21  8:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from manu at gcc dot gnu dot org  2007-05-21 09:54 -------
*** Bug 11051 has been marked as a duplicate of this bug. ***


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org


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


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

* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
       [not found] <bug-22168-638@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2007-05-21  8:54 ` manu at gcc dot gnu dot org
@ 2008-02-26 20:49 ` tromey at gcc dot gnu dot org
  2008-05-13 14:52 ` tromey at gcc dot gnu dot org
  2008-05-13 15:22 ` tromey at gcc dot gnu dot org
  6 siblings, 0 replies; 13+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-02-26 20:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from tromey at gcc dot gnu dot org  2008-02-26 20:48 -------
*** Bug 35312 has been marked as a duplicate of this bug. ***


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |neil at gcc dot gnu dot org


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


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

* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
       [not found] <bug-22168-638@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2008-02-26 20:49 ` tromey at gcc dot gnu dot org
@ 2008-05-13 14:52 ` tromey at gcc dot gnu dot org
  2008-05-13 15:22 ` tromey at gcc dot gnu dot org
  6 siblings, 0 replies; 13+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-05-13 14:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from tromey at gcc dot gnu dot org  2008-05-13 14:51 -------
Subject: Bug 22168

Author: tromey
Date: Tue May 13 14:50:27 2008
New Revision: 135264

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135264
Log:
libcpp
        PR preprocessor/22168:
        * include/cpplib.h (struct cpp_options) <objc>: Update
        documentation.
        * expr.c (eval_token): Warn for use of assertions.
        * directives.c (directive_diagnostics): Warn about extensions.
        (DEPRECATED): New define.
        (DIRECTIVE_TABLE): Use it.
gcc
        PR preprocessor/22168:
        * doc/cpp.texi (Top): Update menu.
        (Alternatives to Wrapper #ifndef): New node.
        (Other Directives): Document deprecation.
        (Obsolete Features): Remove menu.
        (Assertions): Merge node into Obsolete Features.
        (Obsolete once-only headers): Move earlier; rename to Alternatives
        to Wrapper #ifndef.
        * doc/cppopts.texi: Update.
        * c.opt (Wdeprecated): Enable for C and ObjC.
        * doc/invoke.texi (Option Summary): Move -Wno-deprecated.
        (C++ Dialect Options): Move -Wno-deprecated from here to...
        (Warning Options): ... here.
gcc/testsuite
        PR preprocessor/22168:
        * gcc.dg/pch/import-2.hs: Add -Wno-deprecated.
        * gcc.dg/pch/import-1.hs: Add -Wno-deprecated.
        * gcc.dg/pch/import-2.c: Add -Wno-deprecated.
        * gcc.dg/pch/import-1.c: Add -Wno-deprecated.
        * gcc.dg/cpp/import2.c: Add -Wno-deprecated.
        * gcc.dg/cpp/import1.c: Add -Wno-deprecated.
        * gcc.dg/cpp/trad/assert3.c: Add -Wno-deprecated.
        * gcc.dg/cpp/trad/assert2.c: Add -Wno-deprecated.
        * gcc.dg/cpp/trad/assert1.c: Add -Wno-deprecated.
        * gcc.dg/cpp/ident.c: Add -Wno-deprecated.
        * gcc.dg/cpp/ident-1.c: Add -Wno-deprecated.
        * gcc.dg/cpp/extratokens.c: Add -Wno-deprecated.
        * gcc.dg/cpp/assert3.c: Add -Wno-deprecated.
        * gcc.dg/cpp/assert2.c: Add -Wno-deprecated.
        * gcc.dg/cpp/assert1.c: Add -Wno-deprecated.
        * gcc.dg/cpp/assert4.c: Compile with -ansi and not -pedantic.  Add
        -Wno-deprecated.
        * gcc.dg/cpp/pr22168.c: New file.
        * gcc.dg/cpp/pr22168-2.c: New file.

Added:
    trunk/gcc/testsuite/gcc.dg/cpp/pr22168-2.c
    trunk/gcc/testsuite/gcc.dg/cpp/pr22168.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c.opt
    trunk/gcc/doc/cpp.texi
    trunk/gcc/doc/cppopts.texi
    trunk/gcc/doc/invoke.texi
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/cpp/assert1.c
    trunk/gcc/testsuite/gcc.dg/cpp/assert2.c
    trunk/gcc/testsuite/gcc.dg/cpp/assert3.c
    trunk/gcc/testsuite/gcc.dg/cpp/assert4.c
    trunk/gcc/testsuite/gcc.dg/cpp/extratokens.c
    trunk/gcc/testsuite/gcc.dg/cpp/ident-1.c
    trunk/gcc/testsuite/gcc.dg/cpp/ident.c
    trunk/gcc/testsuite/gcc.dg/cpp/import1.c
    trunk/gcc/testsuite/gcc.dg/cpp/import2.c
    trunk/gcc/testsuite/gcc.dg/cpp/trad/assert1.c
    trunk/gcc/testsuite/gcc.dg/cpp/trad/assert2.c
    trunk/gcc/testsuite/gcc.dg/cpp/trad/assert3.c
    trunk/gcc/testsuite/gcc.dg/pch/import-1.c
    trunk/gcc/testsuite/gcc.dg/pch/import-1.hs
    trunk/gcc/testsuite/gcc.dg/pch/import-2.c
    trunk/gcc/testsuite/gcc.dg/pch/import-2.hs
    trunk/libcpp/ChangeLog
    trunk/libcpp/directives.c
    trunk/libcpp/expr.c
    trunk/libcpp/include/cpplib.h


-- 


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


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

* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
       [not found] <bug-22168-638@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2008-05-13 14:52 ` tromey at gcc dot gnu dot org
@ 2008-05-13 15:22 ` tromey at gcc dot gnu dot org
  6 siblings, 0 replies; 13+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-05-13 15:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from tromey at gcc dot gnu dot org  2008-05-13 15:20 -------
Fixed on trunk.
I think we're unlikely to backport this, so I'm closing it.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.4.0


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


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

* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
  2005-06-24  2:04 [Bug preprocessor/22168] New: #if #A == #B should have a diagnostic geoffk at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-06-24 23:09 ` joseph at codesourcery dot com
@ 2005-06-25 22:11 ` jsm28 at gcc dot gnu dot org
  5 siblings, 0 replies; 13+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2005-06-25 22:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jsm28 at gcc dot gnu dot org  2005-06-25 22:11 -------
Diagnostic needed for -pedantic (and in general I don't like extensions not
being diagnosed with -pedantic even where diagnostics aren't strictly required).

[comment#10 did not appear on gcc-bugs - apparently substantive messages should
not be sent to gcc-bugzilla with signatures or other attachments.]


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |16620, 16989
              nThis|                            |


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


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

* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
  2005-06-24  2:04 [Bug preprocessor/22168] New: #if #A == #B should have a diagnostic geoffk at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-06-24 22:41 ` schwab at suse dot de
@ 2005-06-24 23:09 ` joseph at codesourcery dot com
  2005-06-25 22:11 ` jsm28 at gcc dot gnu dot org
  5 siblings, 0 replies; 13+ messages in thread
From: joseph at codesourcery dot com @ 2005-06-24 23:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From joseph at codesourcery dot com  2005-06-24 23:09 -------
Subject: Re:  #if #A == #B should have a diagnostic
 in ISO C mode

On Fri, 24 Jun 2005, neil at gcc dot gnu dot org wrote:

> My copy of the standard only requires a constant expression - can you point out
> where you read its requiring an integer constant expression?

6.10.1#1, "shall be an integer constant expression"; 6.8.1 in C90.

> The standard explicitly permits extensions to constant expressions.  Since this

But not to integer constant expressions (at least according to the view 
expressed in the DR#312 discussion in the draft Lillehammer minutes, 
although DR#032 implies a different view).



-- 


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


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

* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
  2005-06-24  2:04 [Bug preprocessor/22168] New: #if #A == #B should have a diagnostic geoffk at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-06-24 22:26 ` pinskia at gcc dot gnu dot org
@ 2005-06-24 22:41 ` schwab at suse dot de
  2005-06-24 23:09 ` joseph at codesourcery dot com
  2005-06-25 22:11 ` jsm28 at gcc dot gnu dot org
  5 siblings, 0 replies; 13+ messages in thread
From: schwab at suse dot de @ 2005-06-24 22:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schwab at suse dot de  2005-06-24 22:41 -------
The standard does not allow to extend the syntax.  Since this violates the 
syntax of the language a diagnostic is required. 

-- 


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


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

* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
  2005-06-24  2:04 [Bug preprocessor/22168] New: #if #A == #B should have a diagnostic geoffk at gcc dot gnu dot org
  2005-06-24 18:02 ` [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode geoffk at gcc dot gnu dot org
  2005-06-24 22:24 ` neil at gcc dot gnu dot org
@ 2005-06-24 22:26 ` pinskia at gcc dot gnu dot org
  2005-06-24 22:41 ` schwab at suse dot de
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-24 22:26 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-06-24 22:26:42
               date|                            |


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


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

* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
  2005-06-24  2:04 [Bug preprocessor/22168] New: #if #A == #B should have a diagnostic geoffk at gcc dot gnu dot org
  2005-06-24 18:02 ` [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode geoffk at gcc dot gnu dot org
@ 2005-06-24 22:24 ` neil at gcc dot gnu dot org
  2005-06-24 22:26 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: neil at gcc dot gnu dot org @ 2005-06-24 22:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From neil at gcc dot gnu dot org  2005-06-24 22:24 -------
(In reply to comment #6)
> Yup, it's documented.  However, it's still silently accepted even with
-pedantic, and the language doesn't 
> permit that.

My copy of the standard only requires a constant expression - can you point out
where you read its requiring an integer constant expression?

The standard explicitly permits extensions to constant expressions.  Since this
extension is explicitly documented as for use in #if expressions, it should be
obvious that we intend #foo as a constant expression.  No diagnostic is
therefore required.

-- 


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


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

* [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode
  2005-06-24  2:04 [Bug preprocessor/22168] New: #if #A == #B should have a diagnostic geoffk at gcc dot gnu dot org
@ 2005-06-24 18:02 ` geoffk at gcc dot gnu dot org
  2005-06-24 22:24 ` neil at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2005-06-24 18:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From geoffk at gcc dot gnu dot org  2005-06-24 18:02 -------
Yup, it's documented.  However, it's still silently accepted even with -pedantic, and the language doesn't 
permit that.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|#if #A == #B should have a  |#if #A == #B should have a
                   |diagnostic                  |diagnostic in ISO C mode


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


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

end of thread, other threads:[~2008-05-13 15:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-22168-638@http.gcc.gnu.org/bugzilla/>
2006-12-29  2:54 ` [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode tromey at gcc dot gnu dot org
2007-01-01 21:57 ` patchapp at dberlin dot org
2007-01-08  1:33 ` tromey at gcc dot gnu dot org
2007-05-21  8:54 ` manu at gcc dot gnu dot org
2008-02-26 20:49 ` tromey at gcc dot gnu dot org
2008-05-13 14:52 ` tromey at gcc dot gnu dot org
2008-05-13 15:22 ` tromey at gcc dot gnu dot org
2005-06-24  2:04 [Bug preprocessor/22168] New: #if #A == #B should have a diagnostic geoffk at gcc dot gnu dot org
2005-06-24 18:02 ` [Bug preprocessor/22168] #if #A == #B should have a diagnostic in ISO C mode geoffk at gcc dot gnu dot org
2005-06-24 22:24 ` neil at gcc dot gnu dot org
2005-06-24 22:26 ` pinskia at gcc dot gnu dot org
2005-06-24 22:41 ` schwab at suse dot de
2005-06-24 23:09 ` joseph at codesourcery dot com
2005-06-25 22:11 ` jsm28 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).