This is the mail archive of the gcc-bugs@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: #ident does not add information to object file


> 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


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