Question about __attribute__ (mis)handling
Ira Ruben
ira@apple.com
Wed Dec 12 11:57:00 GMT 2001
I have a question about __attribute__ handling for C++ inline member
functions. Given the following example:
struct T1 {
void __attribute__ ((this_will_be_a_warning)) t1_member1();
void t1_member2() __attribute__ ((this_will_be_an_warning_too));
};
struct T2 {
void __attribute__ ((this_should_also_be_an_warning)) t2_member1() {}
void t2_member2();
};
inline void __attribute__ ((it_catches_this_as_a_warning_here))
T2::t2_member2() {}
int foo(T2 *p)
{
p->t2_member1();
}
It turns out that an __attribute__ for inline members defined within
their class is effectively ignored when the __attribute__ is placed
before the function name. So should this be considered a bug? Or
should __attribute__ in that position even be allowed?
Ira
More information about the Gcc
mailing list