[cfe-dev] -Wimplicit-function-declaration doesn't work?
Alexei Svitkine
alexei.svitkine at gmail.com
Wed Jan 28 18:39:30 PST 2009
Thanks. Shouldn't the other option work as intended, though?
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
>
More information about the cfe-dev
mailing list