从gcc init_priority属性中抑制警告 [英] Supress warning from gcc init_priority attribute

查看:406
本文介绍了从gcc init_priority属性中抑制警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

G ++向我发出有关init_priority属性的警告:

G++ is giving me warnings about init_priority attribute:

g++ -c -o src/core/ModuleManager.o -Wall -fPIC -imacros ./src/configs/config.hpp -O2 -I./src/include  src/core/ModuleManager.cpp
src/core/ModuleManager.cpp:27:29: warning: requested init_priority is reserved for internal use

是否有办法抑制此特定警告?

Is there a way to supress this specific warning?

推荐答案


是否有办法抑制此特定警告?

Is there a way to supress this specific warning?

是:不要使用为内部使用保留的init_priority(优先级<= 100)。

Yes: don't use init_priority reserved for internal use (priority <= 100).

/ em>它是保留的,如果你忽略该警告,你最终将不得不调试一个你很难理解的问题。

There is a reason it is reserved, and if you ignore the warning, you'll eventually have to debug a problem you will have hard time understanding.

不要骗你的编译器 - 它会得到你!

Never lie to your compiler -- it will get you!

这篇关于从gcc init_priority属性中抑制警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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