This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: #ident does not add information to object file
- To: hans dot beckerus at uab dot ericsson dot se
- Subject: Re: #ident does not add information to object file
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sun, 21 Nov 1999 15:24:03 +0100
- CC: gcc-bugs at gcc dot gnu dot org
- References: <38301FCC.46B3483B@uab.ericsson.se>
> I have discovered a problem with gcc/g++ regarding the support
> for #ident. According to documentation #pragma ident is not
> supported but #ident <string> was stated to be supported for backwards
> compatibility. However, when looking in the object files
> produced nothing is placed in the .comment section.
Thanks for your bug report. As you've noticed, this feature exists for
backwards compatibility. This means:
- source code containing #ident is accepted, even though it is not
standard C (compiling with -pedantic will give you a warning)
- on some platforms, an instruction is put into the assembler file
Whether or not that leads to a string in the final executable is a
matter of the assembler and linker.
Trying your example with gcc 2.95.2 on Solaris 2.5.1, the resulting
assembler output is
.file "a.c"
gcc2_compiled.:
.ident "@(#) filename.h 0.1 1999-11-12"
.ident "GCC: (GNU) 2.95.2 19991024 (release)"
Compiling this with /usr/ccs/bin/as, I get both strings in comment
section of the resulting object.
Regards,
Martin