Remove note of GCC ABI change

匿名 (未验证) 提交于 2019-12-03 01:22:02

问题:

When I compile my program with GCC 4.7 I get the following note:

/usr/include/c++/4.7/backward/binders.h:167:5: note: the ABI of passing structure with complex float member has changed in GCC 4.4 here 

Is there any way to get rid of it? I tried to google it, but all I find is the GCC source code line that prints the note string.

回答1:

Pass the option -Wno-psabi to GCC.



回答2:

I was getting the same message:

/usr/include/c++/4.8.3/bits/stl_pair.h:276:5: note: the ABI of passing structure with complex float member has changed in GCC 4.4 

for the following line of code:

indices.push_back(make_pair(centreIndex,centre)); 

where centreIndex is an integer and centre is a complex float.

To get rid of the error message I changed the code to:

indices.push_back(pair<int,complex<float> >(centreIndex,centre)); 

I think this is a better way of doing it because make_pair is just a wrapper for this more direct way of creating a pair.



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