Skip to content

suppress -Wmissing-field-initializers on GCC/Clang - #253

Merged
adam-ce merged 2 commits into
AlpineMapsOrg:mainfrom
MatzeOGH:fix/suppress-missing-field-initializers
Aug 9, 2026
Merged

suppress -Wmissing-field-initializers on GCC/Clang#253
adam-ce merged 2 commits into
AlpineMapsOrg:mainfrom
MatzeOGH:fix/suppress-missing-field-initializers

Conversation

@MatzeOGH

@MatzeOGH MatzeOGH commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

In C++, a designated initializer is still aggregate initialization, so any member you don't name is value-initialized to zero (nextInChain = nullptr, label = {}, etc.) which is the intended default, rather than left uninitialized.

@adam-ce
adam-ce marked this pull request as ready for review August 7, 2026 19:57
@adam-ce
adam-ce requested review from adam-ce and a lite review from Copilot August 7, 2026 21:21

@adam-ce adam-ce left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should go to

target_compile_options(nucleus PRIVATE -Wall -Wextra -pedantic -Werror)
(the other warnings are there as well) and be target specific. all the other targets will inherit it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the project’s CMake configuration to suppress -Wmissing-field-initializers when building with GCC/Clang-family compilers, aligning the build output with the intended C++ aggregate/designated-initializer semantics described in the PR.

Changes:

  • Adds a GCC/Clang conditional compile-option to disable -Wmissing-field-initializers globally.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CMakeLists.txt Outdated
Comment on lines +106 to +108
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-Wno-missing-field-initializers)
endif()
@MatzeOGH

MatzeOGH commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

this should go to

target_compile_options(nucleus PRIVATE -Wall -Wextra -pedantic -Werror)

(the other warnings are there as well) and be target specific. all the other targets will inherit it.

done

@adam-ce
adam-ce merged commit dce9511 into AlpineMapsOrg:main Aug 9, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants