This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/19031] New: #pragma weak handling changes in 4.0.0


compiling Xorg's X11 with gcc 4.0.0 20041215 (experimental) fails because the 
handling of '#pragma weak' seems to hve changed. The testcode, derived from 
xc/lib/xtrans/Xtranssock.c: 
 
------------------cut----------------- 
extern int foo; 
static const int bar = 1; 
#pragma weak foo=bar 
-------------------------------------- 
 
when compiled with gcc 3.3.4 the resulting object shows 
 
0000000000000000 r bar 
0000000000000000 V foo 
 
i.e. bar as local symbol and foo as a weak alias. 
 
When compiled with 4.0.0 20041215, the object only has bar listed 
as an undefined Symbol. 
 
The X.org Xtranssock.c code is doing the above trick to define a weak alias for 
in6addr_any to provide compatibility for apps linked against system libraries 
that don't have IPv6 support. 
 
Now the question is, who is wrong. If it's the X11 code, how could the code 
possibly be changed?

-- 
           Summary: #pragma weak handling changes in 4.0.0
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pth at suse dot de
                CC: aj at suse dot de,gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86_64-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19031


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]