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.
"Compilers such as GCC accept multiple source file names on a single command like."
Just that gcc isn't a C compiler. It is just the command line processor that will take a command line with a list of source files object files libraries flags etc and then send out the relevant information to one or more background programs that does the actual work of compiling, assembling and linking.
gcc isn't alone in supporting many source file names on the command line - just about all C compiler tools supports that. But the actual compiler part of the tools sees one source file at a time. Then optimization tools may perform cross-module optimization by walking anre rewriting the expression trees created by the compiler before they generate the machine code output.
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.