Supress warning from gcc init_priority attribute

寵の児 提交于 2019-12-11 11:55:47

问题


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?


回答1:


Is there a way to supress this specific warning?

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

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!



来源:https://stackoverflow.com/questions/10564368/supress-warning-from-gcc-init-priority-attribute

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!