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]

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


> Since the current uses of _GLOBAL_OFFSET_TABLE_ (which would
> NOT present a problem for, e.g., ELF) are hardcoded into literal
> strings in the compiler source (as part of instruction
> source lines), which in turn becomes part of the .s file,
> the symbol name needs to be changed in those strings,
> which becomes a preprocessor trick.

I see. If this is really a problem, why not just change the compiler?
Hacking with the preprocessor seems to produce more problems than it
solves. Consider

#define SHOW(x) printf(#x " is %d\n", x);

int main()
{
  int GLOBAL_OFFSET_TABLE_ = 1,
  SHOW(GLOBAL_OFFSET_TABLE_);
}

With your hack, you'd break this program.

Regards,
Martin


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