Bruce Lilly <[EMAIL PROTECTED]> writes: > Earlier versions of gcc retain static character strings in object > files which can be used for identification via ident (RCS) or what > (SCCS). Gcc 4.0.0 removes them above optimization level 1.
The first observation I'd like to make is that we (the GCC developers, collectively) don't really understand the need for this. We don't put $Id$ strings in our own source code, never mind the object files. The attitude is that the version number of the program as a whole suffices to figure out which release branch to go looking for the bug in. Therefore, I hesitate to give you any sort of advice, because as long as there's no one on the GCC team who understands why this needs to work, people are going to continue to break it. I do have three suggestions for you: 1) The current way to tell the compiler not to throw away apparently-unused data is __attribute__((used)), like this: static const char __attribute__((used)) rcs_sccs_id[] = "$Id: @(#)%M% %I% 20%E% %U% copyright 2005 %Q% string1\\ $"; You can hide this behind a macro so it doesn't interfere with other compilers. 2) #ident currently does something useful if and only if the back-end defines what to do with it. However, we could define a sensible default, e.g. converting it to a global string declaration like the one above. I'd be happy to take a patch that made that change. However, the purpose of -fno-ident is to make #ident do nothing; we're not going to change that. I'm a little confused why you even bring it up. 3) #sccs does nothing because no one has ever told me what it was supposed to do, or even what its argument syntax was. From what you write, it's functionally identical to #ident; I'd be happy to take a patch that made #sccs an alias for #ident. zw