I used to set this at top of my source files to be able to grep -a "ID :"
on my binaries :
#ident "\\n$@ ID : my_library.o v1.3 (25/08/07)@$\\n"
However, this is deprecated in GCC 4.3.3. Any suggestions ?
I came through __attributes__(section())
, but not sure if this will get stripped, and anyway, I was guessing there was a more straightforward way.
Thank you
The #ident directive (as well as #sccs) was undeprecated, so you should just keep it!
来源:https://stackoverflow.com/questions/3650222/best-replacement-for-gcc-ident