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: Sat, 01 Jan 2005 13:09:13 -0800
Guy Harris wrote:

-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.

-ansi -pedantic produced a bunch of warnings that I cleaned up (a bunch of complaints about casting away constness - unfortunately, some can't be eliminated, either due to function signatures in external libraries that should have const but don't, or due to there not being a way I know of in C to say "once I've allocated this object and filled it in, and assigned the pointer to this variable or structure member, nobody's allowed to modify it, but when we're done with it I can free it", so you have to cast away the constness when freeing it - and some other cast issues).

However, -pedantic without -ansi produced the same warnings; presumably that's because, at least on the version of OS X I'm using, no declaration or definition that's omitted with __STRICT_ANSI__ is required, or something such as that.