This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/579: -Wmissing-noreturn not supported in C++
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/579: -Wmissing-noreturn not supported in C++
- From: Joseph Myers <jsm28 at cam dot ac dot uk>
- Date: Fri, 29 Sep 2000 11:52:26 +0000
- Cc: jsm28 at cam dot ac dot uk
- Resent-Cc: gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, jason at gcc dot gnu dot org
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, Joseph Myers <jsm28@cam.ac.uk>
>Number: 579
>Category: c++
>Synopsis: -Wmissing-noreturn not supported in C++
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Fri Sep 29 04:56:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Joseph S. Myers
>Release: 2.96
>Organization:
none
>Environment:
System: Linux decomino 2.2.17 #1 Mon Sep 4 20:22:16 UTC 2000 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
>Description:
I noticed that the C++ compiler does not support the GCC option
-Wmissing-noreturn. However, this seems not to be documented
anywhere; the option is silently ignored.
>How-To-Repeat:
Compile the following code with -Wmissing-noreturn as both C and C++.
Notice that a warning is only given when compiled as C.
#include <stdlib.h>
void
foo (void)
{
exit (0);
}
>Fix:
In decreasing order of preference:
(1) Find some place where the code for this warning can be shared
between C and C++, and implement the warning there; or
(2) Implement it separately in the C++ compiler; or
(3) Document that it is a C-specific warning.
>Release-Note:
>Audit-Trail:
>Unformatted: