小编Eri*_*tin的帖子

C 编译器优化局部静态变量是否合法?

对于像这样的函数

int test(void) {
  static int x = 0;
  x++;
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

C 编译器允许优化吗x

作为参考,GCC 6.3.0 或 Clang 3.9 都没有优化使用x-O3 的增量。

c static local compiler-optimization

5
推荐指数
1
解决办法
413
查看次数

标签 统计

c ×1

compiler-optimization ×1

local ×1

static ×1