I have one file in which I use "int16_t x", when I declared it in other file, by mistake I have declared "extern int8_t x". i.e int8_t is used instead of int16_t.
But compiler do not generate warning for this. Why. Is there any method for it or it has to be taken care by the programmer only.
Quote: Just that gcc isn't a C compiler.
True. But that is the end of the package that people most frequently consider to be the one used to compile a unit or an application. Microsoft have the same with cl for compilers and ml for assemblers. I wonder how many people would use (or even know of) the executable that is triggered by these key applications.
So, that being the case, it is quite possible (and indeed not unusual) for the compiler to 'go the next step' and do global optimizations, verification checks etc.