[Prev][Next][Index][Thread]

Re: Agree: Require ANSI C for development [Was: libwww ]



In message <9407131917.AA22698@dxmint.cern.ch>, hallam@alws.cern.ch writes:
>
>>Not only should we require an ANSI C compiler for development, but we
>>should write squeaky-clean ANSI C code, except for modules that need
>>POSIX features, in which case we should write squeaky-clean POSIX code.
>
>I don't like using gcc for development for this very reason.. I get many more 
>error messages from the DEC-C compiler on VMS...

To get gcc to act as a strictly conforming ANSI C compiler, invoke it as:

	gcc -ansi -pedantic-errors

My personal favorite is:

	gcc -ansi -pedantic-errors -O -g -Wall

The combination of -O and -Wall will produce some very interesting warnings:
	* variable used before initialized
	* variable not used at all
	* implicitly declared function (i.e. you forgot <stdio.h> or some such)
	* pointer abuse

Dan


References: