Redhat Enterprise 3 上的 gcc4.5 使用 asm 警告消息
我在64位Redhat enterprise 3机器上编译了gcc 4.5.2(2.4.21-20.ELsmp,glibc 2.3.2)。它编译正常,但有很多警告消息,例如
/tmp/ccbGRF5F.s: Assembler messages:
/tmp/ccbGRF5F.s:29: Warning: rest of line ignored; first ignored character is `d'
/tmp/ccbGRF5F.s:33: Warning: rest of line ignored; first ignored character is `d'
/tmp/ccbGRF5F.s:169: Warning: rest of line ignored; first ignored character is `i'
“然后我尝试使用编译器编译代码”,但它仍然会发出这些 asm 警告,并且我没有在我的 C 代码中使用任何 asm。我怎样才能摆脱它?修复或抑制警告都可以。
I compiled gcc 4.5.2 on a 64bit Redhat enterprise 3 machine (2.4.21-20.ELsmp, glibc 2.3.2). It compiles ok but with a lot of warning message like
/tmp/ccbGRF5F.s: Assembler messages:
/tmp/ccbGRF5F.s:29: Warning: rest of line ignored; first ignored character is `d'
/tmp/ccbGRF5F.s:33: Warning: rest of line ignored; first ignored character is `d'
/tmp/ccbGRF5F.s:169: Warning: rest of line ignored; first ignored character is `i'
Then I try to compile code with the compiler, still it spits these asm warnings, and I'm not using any asm in my C code. How can I get rid of it? Fix or suppress warning are all fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来您的 binutils 太旧了,无法处理 gcc-4.5 的输出 - 在另一个项目中,它可能会完全以编译失败结束。对于 RHEL3,这根本不会让我感到惊讶。
It seems your binutils is too old to handle gcc-4.5's output - and in another project it might outright end in a compile failure. Given RHEL3, that would not surprise me at all.
我假设您正在使用命令行来编译?在编译命令中添加“-w”标志将抑制所有警告。例如,在没有警告的情况下编译 hello.c:
将生成输出文件“hello”,而不吐出任何错误。
I'm assuming you're using the command line to compile? adding a "-w" flag to the compile command will suppress all warnings. For example, to compile hello.c without warnings:
Will produce the output file "hello", without spitting out any errors.