This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bootstrap with -Wmissing-prototypes doesn't work for C++
Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
> On Fri, Aug 19, 2011 at 11:17 PM, Ian Lance Taylor <iant@google.com> wrote:
>> Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
>>
>>> what would it do? ÂThere is no notion of `prototype' in C++ (as C
>>> programmers understand it).
>>> So, what would it mean to warn about something we can't take the
>>> negation of? ;-)
>>
>> -Wmissing-prototypes means that if the compiler sees a globally visible
>> function definition, it warns if no previous definition of the function
>> was seen. ÂThis is a way of ensuring that the file which defines a
>> function #includes the header file which declares the function, thus
>> ensuring that the definition matches the declaration. ÂAlthough the name
>> is wrong for C++, the option is meaningful for C++ just as it is for C.
>
> So that is -Wmissing-declaration if I understand correctly?
Hmmm, you're right, -Wmissing-declarations seems to be equivalent to
-Wmissing-prototypes when using C++. Sorry I missed that.
Ian