help-gplusplus
[Top][All Lists]
Advanced

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

Re: -O2 issue with g++ version 3.3.3


From: Pierre Sangouard
Subject: Re: -O2 issue with g++ version 3.3.3
Date: Tue, 23 Aug 2005 19:52:43 +0200

Ulrich Eckhardt wrote:
> Pierre Sangouard wrote:
>> extern "C" {
>> static void *
>> IpmiOpen( void *handler_config )
>> {
>>   return handler_config;
>> }
>>
>> void * oh_open (void *) __attribute__ ((weak, alias("IpmiOpen")));
>> }
>
>> With g++ version 3.2.3 (Redhat EL 3.0), 3.4.4 (Fedora Core 3) and
>> 4.0.1 (Fedora Core 4) the output of "nm buggpp.o" is the following:
>>
>> 00000000 t IpmiOpen
>> 00000000 W oh_open
>>
>> But with g++ version 3.3.3 (Suse Linux ES 9.0) I get:
>>
>>          U IpmiOpen
>
> Hmmm, I just read [1] and it says you need to use the decorated name,
> though that should be the same.

This is actually not necessary since surrounded by extern "C" {} construct

>Anyhow: don't make functions that you
> want exported file-static. Alternatively (but I personally find that
> backward) you could possibly add the attribute 'used' to IpmiOpen.

I know that this piece of code is not very pretty but what I am trying to 
understand is why it fails with g++ 3.3.3 and not with older _and_ newer 
versions.
>
> Just my 2cc
>
> Uli


Thanks for the help,
Pierre

>
> [1] http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]