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: Ulrich Eckhardt
Subject: Re: -O2 issue with g++ version 3.3.3
Date: Tue, 23 Aug 2005 18:13:11 +0200
User-agent: KNode/0.8.2

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. 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.

Just my 2cc

Uli

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

-- 
http://gcc.gnu.org/faq.html
http://parashift.com/c++-faq-lite/



reply via email to

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