warning: -Wuninitialized is not supported without -O

前端 未结 3 878
故里飘歌
故里飘歌 2021-01-18 00:11

The compiler complains about this, after I activated all kind of warnings:

For MyApp_Prefix.pch the compiler says:

warning: -Wuninitialized is

相关标签:
3条回答
  • 2021-01-18 00:47

    And for the uninitiated (like me), go to the Build Settings panel and filter the list for "Uninitialized Automatic Variables" then flip the flag to "No" to disable this warning. If your project file is selected this will apply across all build targets, or you can select a specific build target and change it per target.

    enter image description here

    0 讨论(0)
  • 2021-01-18 00:51

    In plain English, the compiler is complaining that it cannot check for uninitialized variables unless you turn on compiler optimization.

    Chances are that it doesn't do quite such an exhaustive code path analysis if the optimizer is turned off and thus doesn't have all the necessary data to work out if a certain variable is uninitialized or not.

    Simplest fix for the complaint is to turn off the warning for non-optimized builds and ensure that it's turned on for optimized release builds.

    0 讨论(0)
  • 2021-01-18 00:53

    Turn on compiler optimizations.

    Compiler optimizations

    0 讨论(0)
提交回复
热议问题