warning: -Wuninitialized is not supported without -O

前端 未结 3 877
故里飘歌
故里飘歌 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: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.

提交回复
热议问题