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]

ISO C violation (really -- style & string pasting)


In i386.md, there's a potential ISO C violation:
"_GLOBAL_OFFSET_TABLE_" is spelled literally with a single
leading "_", and appears inside longer strings.  (Ditto in
i386.c.).  On many systems ((most?) ELF included), this is fine
because the namespace doesn't implictly prefix "_".

However, on those that do prefix "_" (e.g. a.out, coff for i386
Windows), this violates namespace because it collides with the user
symbol GLOBAL_OFFSET_TABLE_.

The easy fix to this is to use a #define and (ISO) string-pasting.
However, I suspect the style rules disallow string-pasting.
(If they don't, then we're done, and I'm home free.)

If I can't use string pasting, the ASn macros come close to
doing what I need, but not quite.  I'd propose introducing
a new one that does do the right thing.  Any problems with
that (other than making sure it works with old cpp-s?)

Also, there are two ways to do this: paste in (however it's
done) just the "_", or the whole symbol name.  Once I 
come up with a solution, it doesn't really matter which I do
(and I believe there already is a define for the prefix
character, but its name escapes me this moment).  Does anyone
have any preferences?

Donn
-- 

===================================================
Donn Terry                  mailto:donn@interix.com
Softway Systems, Inc.        http://www.interix.com
2850 McClelland Dr, Ste. 1800   Ft.Collins CO 80525
Tel: +1-970-204-9900           Fax: +1-970-204-9951
===================================================


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