【问题标题】:Remove note of GCC ABI change删除 GCC ABI 更改的注释
【发布时间】:2012-12-17 12:01:41
【问题描述】:

当我使用 GCC 4.7 编译我的程序时,我得到以下注释:

/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

有什么办法可以摆脱吗?我试图用谷歌搜索它,但我发现的只是打印注释字符串的 GCC 源代码行。

【问题讨论】:

    标签: gcc g++


    【解决方案1】:

    将选项 -Wno-psabi 传递给 GCC。

    【讨论】:

      【解决方案2】:

      我收到了同样的信息:

      /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
      

      对于以下代码行:

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

      其中 centerIndex 是一个整数,而 center 是一个复数浮点数。

      为了摆脱错误消息,我将代码更改为:

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

      我认为这是一种更好的方法,因为 make_pair 只是这种更直接的创建对的方法的包装。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-02-27
        • 1970-01-01
        • 2011-07-23
        • 2016-07-25
        • 1970-01-01
        • 2011-07-22
        • 2015-10-18
        相关资源
        最近更新 更多