Ethereal-dev: Re: [Ethereal-dev] C++ comments in 0.10.0

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Tue, 16 Dec 2003 17:18:29 -0800

On Dec 16, 2003, at 4:55 PM, Devin Heitmueller wrote:

Has anybody given thought to changing the Makefile to use "-ansi" for
GCC?  This would eliminate the ability to do C++ comments along with
some other non-portable features.  Are there any GCC specific features
that we need?

__attribute__? We don't "need" it; however, it means that the compiler will check whether the arguments to various printf-like routines - including "proto_tree_add_text()", "proto_tree_add_XXX_format()", and "col_add_fstr()" - match the format string, which is a Good Thing.

__attribute__ might be enabled even with -ansi, however.

It also disables some predefined macros that identify the system type (some of which which we might use - but we might be able to use some that are available even with -ansi).

It might work, as long as -ansi doesn't cause problems with non-ANSI-C functions and macros from headers specified in ANSI C (e.g., "fdopen()", declared in <stdio.h>, and used in Ethereal, but *not* in the ANSI C standard, as that standard has no notion of UNIX-like file descriptors).

I'll try a build with "-ansi" on Mac OS X 10.3 to see how it works. I'd probably need to try it on a few other platforms as well, e.g. the FreeBSDs and Linuxes I have on machines at home.