Ethereal-dev: Re: [Ethereal-dev] Use of C99 code in 0.10.8

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Wed, 29 Dec 2004 15:49:21 -0800
Guy Harris wrote:

That *might*, on some platforms, cause functions that Ethereal requires not to be declared or cause macros that Ethereal requires not to be defined. I don't remember whether we've ever tried compiling with -ansi. I'll see what happens if I try that on OS X 10.3.7, at least - some other OSes might use __STRICT_ANSI__ in ways that OS X doesn't, so even if it works on OS X it might not work on other platforms.

Well, compiling with -ansi seems to work - and it catches // comments.

Unfortunately, it *doesn't* catch:

	enums where there's a comma after the last element;

	initialization of automatic structures with non-constant values;

	zero-length arrays at the end of a structure;

so it's not going to catch *all* of the GCCisms that might creep into the source code.

-ansi -pedantic might, but it might also catch extensions we *want* to use and that are properly protected by #ifdefs (e.g., declaring some functions as being printf-like, so that the compiler can check the format string against the argument list). I'll try using the --with-extra-gcc-checks option to turn on -pedantic (and some other warnings), to see how well -ansi -pedantic works.