[RFC]: c99 compiled world

Dag-Erling Smørgrav des at des.no
Mon Nov 10 08:54:23 PST 2008


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


More information about the freebsd-current mailing list