C语言 注意:在宏“A_MACRO”的扩展中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29455915/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 11:49:28  来源:igfitidea点击:

note: in expansion of macro 'A_MACRO'

cgcc

提问by nowox

I have hundred of warnings like this when build with gcc:

使用gcc以下命令构建时,我有数百个这样的警告:

foo.c:2690:5: note: in expansion of macro ‘PUT_UINT32'
     PUT_UINT32(state, digest,  0);

How can I get rid of them?

我怎样才能摆脱它们?

-walso hide warnings that I still want to see

-w还隐藏我仍然想看到的警告

回答by chqrlie

I assume you are using clang: when clangdetects an error or a warning in code expanded from a macro, it outputs one line for each macro whose expansion leads to the offending code. Fix the errors and warnings in the final code and these messages will disappear.

我假设您正在使用clang:当clang在从宏扩展的代码中检测到错误或警告时,它会为每个扩展导致违规代码的宏输出一行。修复最终代码中的错误和警告,这些消息将消失。