Home > Enterprise >  GCC warning for using non fixed-width-integer types
GCC warning for using non fixed-width-integer types

Time:01-12

In my C project, I wanted to use only fixed-width-integers and custom-typedefed integers in all places. But unlike other types, char, short, int, long, long long are not types defined in library. Instead they are keywords built into the language. Hence I can't un-include them if I don't want them. Since they are available, I may accidentally use them.

So, I was looking for a GCC compiler switch, something that disables some keywords for a compilation uint, or something that warns me when I use these non fixed-width types. Is there any flag like that?

CodePudding user response:

No there is no GCC compiler switch to remove POD types that are built into the language (or even warn against them). You will have to use due dilligence here or get creative with a custom solution. Like mentioned in the comments, main must return an int type as well.

CodePudding user response:

There is no way!

int is the most basic syntax. If you do that, you'll also want to get rid of define, typedef, and include. It honestly makes no sense.

  • Related