ns3,c,尽管被用作’typeid’的 *** 作数,但仍将评估具有副作用的表达式

ns3,c,尽管被用作’typeid’的 *** 作数,但仍将评估具有副作用的表达式,第1张

概述发生了一些奇怪的事情:我没有修改我的ns3 c代码的任何部分,并且运行编译这是出现的错误: [ 815/1681] cxx: scratch/initial-scenario.cc -> build/scratch/initial-scenario.cc.1.oIn file included from ../scratch/initial-scenario.cc:3:In file incl 发生了一些奇怪的事情:我没有修改我的ns3 c代码的任何部分,并且运行编译这是出现的错误:

[ 815/1681] cxx: scratch/initial-scenario.cc -> build/scratch/initial-scenario.cc.1.oIn file included from ../scratch/initial-scenario.cc:3:In file included from ./ns3/core-module.h:18:In file included from ./ns3/calendar-scheduler.h:24:In file included from ./ns3/scheduler.h:25:In file included from ./ns3/object.h:29:In file included from ./ns3/object-base.h:23:In file included from ./ns3/type-ID.h:25:In file included from ./ns3/trace-source-accessor.h:24:./ns3/callback.h:1244:54: error: Expression with sIDe effects will be evaluated despite being used as an operand to 'typeID' [-Werror,-Wpotentially-evaluated-Expression]                        "got=" << Demangle ( typeID (*other).name () ) << std::endl <<                                                     ^./ns3/fatal-error.h:98:32: note: expanded from macro 'NS_FATAL_ERROR'      std::cerr << "msg=\"" << msg << "\",";           \                               ^1 error generated.

我不明白为什么会出现这个错误.奇怪的是,我在两个不同的目录中使用两个相似的代码,错误出现在两者中,但我没有修改任何东西.可能是编译器的问题?有什么建议吗?

解决方法 我按照此处的建议解决了问题: https://www.nsnam.org/wiki/Ns-3.24-errata

该问题与Xcode 7.0的更新有关

总结

以上是内存溢出为你收集整理的ns3,c,尽管被用作’typeid’的 *** 作数,但仍将评估具有副作用表达式全部内容,希望文章能够帮你解决ns3,c,尽管被用作’typeid’的 *** 作数,但仍将评估具有副作用的表达式所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/langs/1227843.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-05
下一篇 2022-06-05

发表评论

登录后才能评论

评论列表(0条)

保存