[cfe-dev] -Wimplicit-function-declaration doesn't work?

Chris Lattner clattner at apple.com
Wed Jan 28 23:13:42 PST 2009


On Jan 28, 2009, at 6:39 PM, Alexei Svitkine wrote:

> Thanks. Shouldn't the other option work as intended, though?

Yes, this should be fixed on mainline now, thanks for the report.

-Chris

>
>
> I see in clang.cpp:
>
> static llvm::cl::opt<bool>
> WarnImplicitFunctionDeclaration("Wimplicit-function-declaration",
>   llvm::cl::desc("Warn about uses of implicitly defined functions"));
>
> Which seems to describe exactly the case I'm testing for... but that
> option seems to have no effect.
>
> -Alexei
>
> On Wed, Jan 28, 2009 at 7:48 PM, Douglas Gregor <dgregor at apple.com>  
> wrote:
>>
>> On Jan 28, 2009, at 2:09 PM, Alexei Svitkine wrote:
>>
>>> I'm trying to get the warning output of the code:
>>>
>>> int main(void)
>>> {
>>>       strcmp("abc","def");
>>>       return 0;
>>> }
>>>
>>> However, running "clang -Wimplicit-function-declaration" doesn't  
>>> seem
>>> to produce any output.
>>>
>>> Am I doing something wrong?
>>
>> With -pedantic, I see:
>>
>> /Users/dgregor/foo.c:3:2: warning: implicit declaration of function  
>> 'strcmp'
>> is invalid in C99
>>       strcmp("abc","def");
>>       ^
>> 1 diagnostic generated.
>>
>>
>>       - Doug
>>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list