首页 > 解决方案 > 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

这会在我的系统上打印“这永远不应该打印”。

标签: c++solaris

解决方案


推荐阅读