最佳替代GCC #ident [英] Best replacement for GCC #ident

查看:164
本文介绍了最佳替代GCC #ident的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前将此设置为源文件的顶部,以便能够在我的二进制文件上grep -a "ID :":

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"

但是,在GCC 4.3.3中已弃用此功能.有什么建议吗?

However, this is deprecated in GCC 4.3.3. Any suggestions ?

我遇到了__attributes__(section()),但不确定是否会被剥离,无论如何,我猜想还有一种更直接的方法.

I came through __attributes__(section()), but not sure if this will get stripped, and anyway, I was guessing there was a more straightforward way.

谢谢

推荐答案

不建议使用#ident指令(以及#sccs),因此应该保留它!

The #ident directive (as well as #sccs) was undeprecated, so you should just keep it!

(请参见 http://gcc.gnu.org/bugzilla/show_bug. cgi?id = 41632 )

这篇关于最佳替代GCC #ident的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆