I think the point is that the effect of -Wmissing-prototypes is always enabled 
in C++, so that switch is rejected.  The solution would seem to be to remove 
that switch from the command line if C++ is used to build; that will produce 
the intended result.

        paul

-----Original Message-----
From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On Behalf Of H.J. Lu
Sent: Friday, August 19, 2011 3:34 PM
To: Joe Buck
Cc: GCC Development
Subject: Re: Bootstrap with -Wmissing-prototypes doesn't work for C++

[hjl@gnu-33 gcc]$ cat x.c
int
foo (int x)
{
  return x;
}
[hjl@gnu-33 gcc]$ ./xgcc -B./ -S -O -Wmissing-prototypes x.c
x.c:2:1: warning: no previous prototype for 'foo' [-Wmissing-prototypes]
[hjl@gnu-33 gcc]$ ./g++ -B./ -S -O -Wmissing-prototypes x.c
cc1plus: warning: command line option '-Wmissing-prototypes' is valid for 
Ada/AdaWhy/C/ObjC but not for C++ [enabled by default]
[hjl@gnu-33 gcc]$ ./g++ -B./ -S -O x.c
[hjl@gnu-33 gcc]$

Is this a bug?

On Fri, Aug 19, 2011 at 12:24 PM, Joe Buck <joe.b...@synopsys.com> wrote:
> I'm confused. Since C++ treats the lack of a prototype as a hard error, what 
> does it mean to make -Wmissing-prototypes useless?
>
> ________________________________________
> From: gcc-ow...@gcc.gnu.org [gcc-ow...@gcc.gnu.org] On Behalf Of H.J. 
> Lu [hjl.to...@gmail.com]
> Sent: Friday, August 19, 2011 9:36 AM
> To: GCC Development
> Subject: Bootstrap with -Wmissing-prototypes doesn't work for C++
>
> Since -Wmissing-prototypes doesn't work for C++, using
> C++ to bootstrap GCC makes -Wmissing-prototypes useless.
> You will see the -Wmissing-prototypes message in stage 1, but you 
> won't see it in stage3 2/3.
>
> --
> H.J.



--
H.J.

Reply via email to