-std's (was Re: v3 link failures analyzed)

Phil Edwards pedwards@disaster.jaj.com
Tue Jan 9 21:58:00 GMT 2001


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'
    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
    -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?


Phil

-- 
pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools.  Fools are protected by more capable fools.


More information about the Gcc mailing list