This is the mail archive of the gcc@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]

attribute "section" problem


Hello,

I am having trouble compiling my project since gcc-3.1.x and later simply
because we are using __attribute__((section("sec_name"))) on the class
members all over the map. This little example will fail to compile:

class a {
public: __attribute__((section("ex_text"))) a();
};

... while ...

class a {
public: a() __attribute__((section("ex_text")));
};

will succeed. I have been searching for quite some time for the answer on that
with no luck. In my humble opinion, the former declaration is correct, though
I might be wrong.

The latest version I have tried my luck is:
gcc version 3.2.1 20021020 (Debian prerelease)

The error message is:
test.cpp:2: warning: `section' attribute ignored
test.cpp:2: declaration does not declare anything
test.cpp:2: parse error before `)' token

I'd pleased to know whether this is a gcc bug or if I'll have to rewrite all
constructor declarations everywhere to have the __attribute__ placed
after the constructor name.

Regards,
Petr Sebor



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