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/17251] New: visibility changes not backward compatible


struct S { int a; };
struct S *a, b;
int c, *d;

#define __hidden __attribute__((visibility ("hidden")))

struct S * __hidden foo0 (void) { return a; }
__hidden struct S *bar0 (void) { return a; }
struct S *baz0 (void) __hidden;
struct S *baz0 (void) { return a; }
int __hidden foo1 (void) { return c; }
__hidden int bar1 (void) { return c; }
int baz1 (void) __hidden;
int baz1 (void) { return c; }
struct S __hidden foo2 (void) { return b; }
__hidden struct S bar2 (void) { return b; }
struct S baz2 (void) __hidden;
struct S baz2 (void) { return b; }
int * __hidden foo3 (void) { return d; }
__hidden int *bar3 (void) { return d; }
int *baz3 (void) __hidden;
int *baz3 (void) { return d; }

is compiled differently with current CVS than it used to be before the
latest visibility changes in July/August.
Before, all functions were hidden, now foo0 and foo3 is not.
This is related to making visibility attribute apply not just to FUNCTION_DECLs,
but also to types.
The thing unclear to me is why the attribute located in between return type
and function name is sometimes applicable to the return type and sometimes
to the FUNCTION_DECL.

-- 
           Summary: visibility changes not backward compatible
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,rth at redhat dot com


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


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