-std's (was Re: v3 link failures analyzed)
Gabriel Dos Reis
Gabriel.Dos-Reis@cmla.ens-cachan.fr
Tue Jan 9 22:27:00 GMT 2001
Phil Edwards <pedwards@disaster.jaj.com> writes:
| On Sun, Dec 31, 2000 at 01:58:32PM +0100, Gabriel Dos Reis wrote:
| > Phil Edwards <pedwards@disaster.jaj.com> writes:
| > | On Sat, Dec 30, 2000 at 04:03:38PM -0600, Robert Lipe wrote:
| > | >
| > | > It seems to me that the -ansi-ness of the testsuite invocation needs to
| > | > match that of the autoconf invocation, but I could be talked out of that.
| > |
| > | Well, they definitely need to match if the testsuite is going to run
| > | on openserver, right? I think we should be using -ansi/-std=c89 when
| > | configuring and building the library when possible.
| >
| > Agreed.
| >
| > | Hmmm... I wonder if std=c89 has any effects on C++?
| >
| > Just for clarity: std=c90 -- even though c89 and c90 are identical.
|
| Well, you know that, and I know that, but the compiler doesn't:
|
| % gcc -std=c90 ib.c
| cc1: unknown C standard `c90'
This must be a bug <g>.
| cc1: unknown C standard `c90'
| %
|
| We could teach the compiler that c89 and c90 are identical, as you say,
| or we could just use one of the expanded forms documented in c-decl.c:
|
| -std=iso9899:1990 same as -ansi
| -std=iso9899:199409 ISO C as modified in amend. 1
| -std=iso9899:1999 ISO C 99
| -std=c89 same as -std=iso9899:1990
The flags should reflect common usage. C89 used to mean the american
standardised ANSI 89 and C90 used to mean ISO C 90. The compiler
should accept -std=c90 to as a synonymous of -std=iso9899:1990.
| -std=c99 same as -std=iso9899:1999
| -std=gnu89 default, iso9899:1990 + gnu extensions
| -std=gnu99 iso9899:1999 + gnu extensions
|
| For v3 I think -std=iso9899:199409 is the closest we want. Gaby? Benjamin?
In an ideal world, yes, you're right. But I have no idea of whether
the compiler understands that.
-- Gaby
More information about the Gcc
mailing list