Re: [RFC]: c99 compiled world

From: Dag-Erling Smørgrav <des_at_des.no>
Date: Mon, 10 Nov 2008 17:54:21 +0100
David Schultz <das_at_FreeBSD.ORG> writes:
> The default is -std=gnu89, which as far as I know is almost identical
> to -std=gnu99. Actually, the only difference I'm aware of is that in
> more recent gcc releases, GNU99 mode uses the C99 rules for inline
> functions.

No, the differences are far greater.  Try compiling the following
program in gnu89 mode:

void *restrict p;
int main(void) { for (int i = 0; i < 1; ++i) continue; }

Right off the bat, I can't think of a language construct that is legal
in gnu99 but not in c99, but I'm sure they exist.

BTW, the definition of gnu89 has changed over time.  I believe that
early versions of gcc 3 would accept the following:

int main(void) { for (int i = 0; i < 1; ++i) continue; return i; }

DES
-- 
Dag-Erling Smørgrav - des_at_des.no
Received on Mon Nov 10 2008 - 15:54:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:37 UTC