Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22240

Can I tell gcc/g++ to warn on missing header guards?

$
0
0

Whether one uses #ifndefs or #pragma onces, compilers understand guards. And every header file (.h/.hpp) should have a guard. Exceptions perhaps for some .inc files that might be intended to be included more than once.

Is there some compiler option to emit a warning (or even an error) if such a guard is missing? One could certainly grep for it but I'd prefer a builtin.


Viewing all articles
Browse latest Browse all 22240

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>