Re: Traditional C rejects ISO C



On Sat, 12 Jun 2004, Carl B. Constantine wrote:

> * no6 pobox com (number6 ip120 gte156 dsl-acs2 sea iinet com) wrote:
> > What's "traditional C?"  Is that K&R C, or the C formerly known as
> > c89, ANSI X3.159-1989?  Then there is ISO C, ISO/IEC 9899:1990.
> > Then there is C99, ISO 9899:1999.  
> 
> Good question, I don't know. All I know is what I get in the warning.


>From the gcc 3.3.3 man page:

       -traditional
       -traditional-cpp
           Formerly, these options caused GCC to attempt to emulate a pre-
           standard C compiler.  They are now only supported with the -E
           switch.  The preprocessor continues to support a pre-standard mode.
           See the GNU CPP manual for details.

>From this wording, I'd say "traditional" does mean K&R C, as I always 
understood "standard C" to be synonymous with c89.  



> 
> > For the purposes of your question, I'd imagine you are refering to 
> > ISO C as c99 and "traditional C" as c89.  As K&R C does not support
> > function prototypes, I cannot imagine you are using that original oldie
> > but goodie.
> > 
> > A good description of the differences between c99 and c89 can be found here:
> > 
> >   http://www.fact-index.com/c/c_/c_programming_language.html
> > 
> > Interestingly, gcc supports most of c99, but Borland and Microsoft C don't.
> 
> I thank you for your reply, however it doesn't really answer my
> question. First, I'm only using gcc, so Borland and MS C don't count.
> Second, I'm obviouslly using gcc's -Wtraditional setting for these
> errors to come up, so my question was: how do I get rid of these errors
> so that everything works correctly while still using -Wtraditional?
> Should I even be using -Wtraditional?


I compiled gtk2.4.2 last weekend, but it was with a very old gcc, so I did
not see this problem.  From my eyeball of glib-2.4.0/glib/gutils.h, I'd
guess the problem is the inline functions.   It is difficult to know for
certain without seeing the warnings you are getting.  I'd also say that
-Wtraditional is to help you keep your code clean of non-traditional
constructs.  Since these are warnings, and not from your code, I suggest try
taking the -Wtraditional out of the compile.  Of course you could try to
debug the cause of the non-traditional warning and submit a patch against
Glade if you have the time. :)

Adam
---
Adam Bernstein   no6 pobox com   http://mpgedit.org/~number6
"Who are you?  The new Number 2.  Who is Number 1?  You are, Number 6.
I am not a number, I am a free man!  Aha ha ha ha ha..."
Key fingerprint =  E1 91 49 4C 24 18 E2 04  7A D3 78 A8 86 A9 7C 38





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]