public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* ISO C violation (really -- style & string pasting)
@ 1999-03-24 16:38 Donn Terry
       [not found] ` < 36F9848A.9F566D1A@interix.com >
  1999-03-31 23:46 ` Donn Terry
  0 siblings, 2 replies; 28+ messages in thread
From: Donn Terry @ 1999-03-24 16:38 UTC (permalink / raw)
  To: egcs

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
===================================================

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~1999-03-31 23:46 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-24 16:38 ISO C violation (really -- style & string pasting) Donn Terry
     [not found] ` < 36F9848A.9F566D1A@interix.com >
1999-03-24 23:35   ` Martin v. Loewis
1999-03-25  8:09     ` Donn Terry
     [not found]       ` < 36FA5EC7.3144D054@interix.com >
1999-03-25 14:26         ` Martin v. Loewis
1999-03-25 15:05           ` Donn Terry
1999-03-25 15:31             ` Martin v. Loewis
1999-03-31 23:46               ` Martin v. Loewis
1999-03-31 23:46             ` Donn Terry
1999-03-31 23:46           ` Martin v. Loewis
1999-03-31 23:46       ` Donn Terry
1999-03-31 23:46     ` Martin v. Loewis
1999-03-25 14:29   ` Richard Henderson
1999-03-25 14:51     ` Donn Terry
1999-03-25 15:07       ` Richard Henderson
1999-03-25 15:25         ` Donn Terry
1999-03-25 15:39           ` Jeffrey A Law
1999-03-31 23:46             ` Jeffrey A Law
1999-03-31 23:46           ` Donn Terry
1999-03-31 23:46         ` Richard Henderson
1999-03-31 23:46       ` Donn Terry
1999-03-25 15:14     ` espie
1999-03-25 15:35       ` Donn Terry
1999-03-31 23:46         ` Donn Terry
1999-03-31 23:46       ` espie
1999-03-25 15:36     ` Jeffrey A Law
1999-03-31 23:46       ` Jeffrey A Law
1999-03-31 23:46     ` Richard Henderson
1999-03-31 23:46 ` Donn Terry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).