Page MenuHome

Silence `-Wmaybe-uninitialized` warning on GCC/Linux
ClosedPublic

Authored by Sybren A. Stüvel (sybren) on Aug 18 2020, 5:51 PM.

Details

Summary

Add -Wno-maybe-uninitialized option to CMAKE_CXX_FLAGS_RELEASE and CMAKE_CXX_FLAGS_RELWITHDEBINFO variables on GCC/Linux.

In Release builds GCC's -Wmaybe-uninitialized warning is unreliable, and thus causes noise that can drown out other warnings. These warnings are now silenced in release mode builds.a

Debug builds seem fine, so flags for debug builds are not touched by this commit.

No functional changes.

Diff Detail

Repository
rB Blender
Branch
arcpatch-D8615 (branched from master)
Build Status
Buildable 9684
Build 9684: arc lint + arc unit

Event Timeline

Sybren A. Stüvel (sybren) requested review of this revision.Aug 18 2020, 5:51 PM
Sybren A. Stüvel (sybren) created this revision.
Sergey Sharybin (sergey) requested changes to this revision.Aug 19 2020, 9:34 AM

Instead of copying flags to RELEASE/RELWITHDEBINFO C/CXX can create a single list of all the flags we want to add, and add them to all the CMAKE variables as needed.

build_files/cmake/platform/platform_unix.cmake
594–595

Keep C and C++ flags matched unless otherwise is not possible.

This revision now requires changes to proceed.Aug 19 2020, 9:34 AM
build_files/cmake/platform/platform_unix.cmake
595–596

Unless i'm missing something, should be C and C++.
Unless C does not support -Wno-maybe-uninitialized for whatever reason.

  • Moar update, now actually the correct one.
Sybren A. Stüvel (sybren) marked an inline comment as done.Aug 20 2020, 1:50 PM
This revision is now accepted and ready to land.Aug 20 2020, 4:05 PM