public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11454] New: pedantic causes errors with exceptions, were warnings under 2.95
@ 2003-07-07 18:27 kirkm at altera dot com
  2003-07-07 23:18 ` [Bug c++/11454] " bangerth at dealii dot org
  0 siblings, 1 reply; 2+ messages in thread
From: kirkm at altera dot com @ 2003-07-07 18:27 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: pedantic causes errors with exceptions, were warnings
                    under 2.95
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P1
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kirkm at altera dot com
                CC: gcc-bugs at gcc dot gnu dot org

Using -pedantic causes warnings under 2.95 to become errors under 3.2.  
Specifically, where tt.C is simply: 

int f(); 
int f() throw(); 

With gcc 2.95 
[picaso]:/il2/users/jeanb> g++ -pedantic -c tt.C 
tt.C:3: warning: declaration of `f()' throws different exceptions 
tt.C:1: warning: previous declaration here 

With gcc 3.2 
[goya]:/il2/users/jeanb> g++ -pedantic -c tt.C 
tt.C:3: declaration of `int f() throw ()' throws different exceptions 
tt.C:1: than previous declaration `int f()' 

This is causing significant headaches for our porting efforts from 2.95 to 3.2 
as 3rd party and OS headers often differ in the way they specify no exceptions 
(either without a throw clause or with a blank throw clause).

Thanks,
Kirk


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

* [Bug c++/11454] pedantic causes errors with exceptions, were warnings under 2.95
  2003-07-07 18:27 [Bug c++/11454] New: pedantic causes errors with exceptions, were warnings under 2.95 kirkm at altera dot com
@ 2003-07-07 23:18 ` bangerth at dealii dot org
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth at dealii dot org @ 2003-07-07 23:18 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From bangerth at dealii dot org  2003-07-07 23:18 -------
This has nothing to do with -pedantic or not: present gcc mainline issues
an error unconditionally. The reason is simply that the language standard
says that these declarations are incompatible and the code is thus
invalid. This is, by the way, the same behavior that for example
Intel's icc shows.

The solution is and must be to leave the declaration of functions to
the system headers and not muck with it. Another possibility, if absolutely
necessary, is to include header files with -isystem instead of -I, since this
shuts down certain checks, such as this one.

W.


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

end of thread, other threads:[~2003-07-07 23:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-07 18:27 [Bug c++/11454] New: pedantic causes errors with exceptions, were warnings under 2.95 kirkm at altera dot com
2003-07-07 23:18 ` [Bug c++/11454] " bangerth at dealii 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).