How do I enable C11?

I am a new mac os user. I want to compile some C code in xcode but I can't run it because it says "implicit declaration of function is invalid in C99". However, when I run the same piece of code on my windows machine it runs. What do I do?

Post not yet marked as solved Up vote post of cekeigwe Down vote post of cekeigwe
1.6k views

Answers

Seen the discussion in this SO thread?

https://stackoverflow.com/questions/15850042/xcode-warning-implicit-declaration-of-function-is-invalid-in-c99

Post not yet marked as solved Up vote reply of KMT Down vote reply of KMT

There is a C language version in the build settings that let's you set the language version to C11.

You can just turn off that particular setting with a build flag: -Wno-implicit-function-declaration


Many open source packages won't build otherwise. Just be careful with it. While some packages require it, other packages may check for the lack of certain functions (to determine which version of a dependency to use) and this would break those packages. I have a project right now that has some of both.


I wouldn't recommend using it on your own code. It is better to properly declare your functions.

Did you manage to solve the problem? If so, tell me how, because I can't find a solution anywhere.