Olin Lathrop embedinc.com> writes: > Peter wrote: > > Compiler errors are not a replacement for linting. > > Why not? Since you are running lint you obviously want to catch these > errors. How would having this capability built into the compiler not solve > the same problem and more simply. > > > Use a linter > > The fact that lint even exists proof of inadequate compiler. ?! A C compiler's purpose is to compile supposedly correct C source into object code, not to find typos and missing braces. As others have noticed, C compiler error messages are cryptic at best. This is because the compiler is actually a tool in a chain that comprises the C preprocessor cpp, the compiler, and the linker. The fact that the compiler can (but must not - more refined make scripts call each tool in turn) invoke all three tools does not make it a linter. Finding errors in the source is simply not the compiler's job. Often it can't figure out the error location because it has to 'look' behind at what the preprocessor did and it is not possible for it to do that, as cpp's purpose is to add and delete lines and modify strings and text in the source following compilation time flags. The normal toolchain is: a.out cc and cpp on unix invoke the other tools as a convenience for simple programs. They refuse to work like that and require a make script for more complex cases. Peter -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist