c++/579: -Wmissing-noreturn not supported in C++

Joseph Myers jsm28@cam.ac.uk
Fri Sep 29 04:56:00 GMT 2000


>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:


More information about the Gcc-bugs mailing list