Reputation: 35207
When I build using a Makefile I add -Wall -g
to my gcc
args to get warnings.
So when I build this code:
#include <stdio.h>
int main()
{
}
I get this warning:
main.c: In function ‘main’:
main.c:10: warning: control reaches end of non-void function
However when I build the same code in XCode I don't see any warnings.
I think XCode is using LLVM instead of GCC but there must be an equivelant. How can I turn this on in XCode?
Upvotes: 3
Views: 418
Reputation: 104698
I think XCode is using LLVM instead of GCC but there must be an equivelant. How can I turn this on in XCode?
You can choose the compiler from the build options area.
GCC_VERSION
in the search field below.If you clear the search field now, you can scroll down to enable specific warnings.
Note that LLVM + GCC is the GCC front end with a LLVM optimizer.
Clang doesn't support all the options GCC does. It also supports a few new ones, or differences. So it's a good idea to build against both.
Upvotes: 1