tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

eliminate gcc extension in crt0.c



A few ports are using the ({ ... }) gcc extension in crt0.c.  Since the other 
ports don't require it, I assume that gcc doesn't optimise away this code any 
longer.  The affected ports are arm32, armelf, i386, m68k, sh3 and vax.


I've tested the following code on i386 4.0 and cats 3.1, and the problem 
doesn't exist.

Can we eliminate this gccism, or at least test if the compiler is actually gcc?


#include <stdio.h>

#if 1
extern int _DYNAMIC __weak_reference(_DYNAMIC);
#else
extern int _DYNAMIC;
__weak_extern(_DYNAMIC);
#endif

int
main()
{
        if (&_DYNAMIC)
                printf("dynamic\n");
        else
                printf("static\n");
        return 0;
}

-- Gregory McGarry <g.mcgarry%ieee.org@localhost>



      Get the name you always wanted with the new y7mail email address.
www.yahoo7.com.au/y7mail




Home | Main Index | Thread Index | Old Index