代码之家  ›  专栏  ›  技术社区  ›  Boon

LLVM是否为基元类型初始化本地变量?

  •  1
  • Boon  · 技术社区  · 10 年前

    LLVM是否为基元类型初始化本地变量?

    我收到警告:

    Variable is uninitialized when used here.
    

    但当我 NSLog 它,它确实显示 0 .

    1 回复  |  直到 10 年前
        1
  •  4
  •   500 - Internal Server Error    10 年前

    如错误所示,LLVM不会自动初始化本地变量。

    看见 http://clang.llvm.org/compatibility.html .

    明确地

    程序必须在 它们与其他局部变量一样被使用。