How can I make clang throw errors when the code is not strictly standard?

I am writing a C ++ 11 library, and I want it to work with every compiler that supports C ++ 11. I don’t want to accidentally write code that is not standard (for example, uses language extensions such as VLA or blocks). How can I make clang disable all language extensions so that I can only write compatible code?

+4
source share
1 answer

Try one of them :

-pedantic: Warn on language extensions. -pedantic-errors: Error on language extensions. 
+7
source

Source: https://habr.com/ru/post/1390973/


All Articles