c++ - developertudio 12.6 在 solaris 上的内联问题
问题描述
考虑以下显示问题的代码。
测试C
#include <stdio.h>
int func2(int x);
// inline the func1.
inline int func1(int y)
{
{
return func2(y);
}
return 1;
}
int func2(int x)
{
return 0;
}
int main(void)
{
if (func1(99))
printf("This should never print\n");
return 0;
}
/opt/developerstudio12.6/bin/CC -o test -m64 -xarch=sparc -O -xmaxopt +w2 -std=c++11 test.C
这会在我的系统上打印“这永远不应该打印”。
解决方案
推荐阅读
- mysql - 如何计算所有发票产品的数量?
- python - 使用scrapy从网站上抓取所有链接不起作用
- html - CSS:宽度属性不适用于 div 标签
- asp.net-mvc - 如何从 Application_Start() ASP.NET MVC 重定向到控制器操作方法
- javascript - 将包含函数的变量从 pug 传递给反应组件
- css - 如何在多个组件中使用微调器
- jquery - Laravel 使用 if 语句添加类
- ios - Fabric Answer 在从 Xcode 10 和 iOS 12 开始时崩溃 iOS 应用程序
- javascript - Jquery 解析部分 XML 并将其保存在 localstorage 中
- java - 如何在 Android 上的两个 Activity 中使用 EventBus