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?
-Alexei
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?
-Alexei
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
Thanks. Shouldn't the other option work as intended, though?
I see in clang.cpp:
static llvm::opt<bool>
WarnImplicitFunctionDeclaration("Wimplicit-function-declaration",
llvm::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
Thanks. Shouldn't the other option work as intended, though?
Yes, this should be fixed on mainline now, thanks for the report.
-Chris