Cross gcc Mailing List Archive

[Prev][Next][Index][Thread]

Re: ident problems using gnu tools




leisner@sdsp.mc.xerox.com said:
> Is an ident string from the #ident  non-ansi nonsense? 

The ANSI equivilent is ``#pragma ident'', but #ident is more ubiquitous.
The reason for using the pragma is to mark the object file but not
consume runtime memory. In large projects, I've seen memory images
shrink frightfully when I removed all the rcsid nonsense. It's well
worth the non-conformance.

Object formats such as ELF and COFF support comment sections, and this
is the PERFECT place to put such ident strings. That is in fact what
the .ident does in assemblers that support it. The ``#ident'' then
generates strings in the .comment section, the linker combines them
into a common place, and the loader ignores them so they do not hurt
the performance of the executable.

Also, a good compiler will notice that rcsid is static, and not used,
and give you a warning that you probably don't want to be bothered with.
Furthermore, such nonsense in a header file simply will not work (#ident
works fine) and even if it did the memory consumption in the loaded image
would be impractically high.



Follow-Ups: References:

Home | Subject Index | Thread Index