[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-bugs
Subject:    [Bug c++/50134] -Wmissing-prototypes doesn't work for C++
From:       "redi at gcc dot gnu.org" <gcc-bugzilla () gcc ! gnu ! org>
Date:       2011-09-30 14:29:18
Message-ID: bug-50134-4-PjW5Nwptdo () http ! gcc ! gnu ! org/bugzilla/
[Download RAW message or body]

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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-09-30 14:29:18 UTC ---
(In reply to comment #6)
> On Fri, 30 Sep 2011, redi at gcc dot gnu.org wrote:
> 
> > I'm not sure what "Do so even if the definition itself provides a prototype."
> > means in the context of C++.
> 
> That's simple enough: it's a style warning: a global function should be 
> declared in a header, so warn for
> 
> int
> f (void)
> {
>   return 0; 
> }
> 
> if there was no previous declaration for f.

I get that part.

>  (For C++, the definition and 
> any previous declaration will always provide a prototype.)

Exactly, that's my point.  But I had missed the fact that the option is valid
in C as well as C++.

My uncertainty was about what that sentence means in the context of C++, and
the answer is nothing, because there are no definitions which do not provide a
prototype in C++ (ignoring the fact that "prototype" doesn't mean anything in
C++).
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic