Skip to content

Fix -Wextra, -Wextra-semi, -Wsign-conversion, and -Wunused-parameter warnings in public headers - #803

Open
clockblocker wants to merge 1 commit into
munich-data-engineering:mainfrom
clockblocker:fix-public-header-warnings
Open

clockblocker wants to merge 1 commit into
munich-data-engineering:mainfrom
clockblocker:fix-public-header-warnings

Conversation

@clockblocker

@clockblocker clockblocker commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

AI-authored below this line.

Problem

Including public reflect-cpp headers under strict warning flags emits 17 warnings across 14 headers, forcing downstream -Werror builds to silence warnings on reflect-cpp globally.

# Compiling public headers with:
#   -Wall -Wextra -Werror -Wsign-conversion -Wextra-semi
#
# Before: 17 warnings across 14 public headers:
#   12 -Wextra-semi
#    2 -Wunused-parameter
#    2 -Wsign-conversion
#    1 -Wmissing-field-initializers (-Wextra)
#
# After:  0 warnings (+22/-18 lines, zero API or behavioral changes)

Summary

  • Removes 12 stray trailing semicolons after function definitions across 9 headers, and adds an explicit .default_value_ = std::nullopt initializer to resolve -Wmissing-field-initializers.
  • Leaves 2 unused template parameters unnamed (matching Fix some unused parameters warnings #582) and adds explicit unsigned casts for std::distance and UTF-8 loop indexing to clear -Wsign-conversion.
  • Pure header hygiene with no public API or runtime behavior changes.

Real-world motivation

Project Reference Context
hudson-trading/slang-server CMakeLists.txt#L317-L321 Suppresses reflect-cpp header warnings in 4 CMake locations.
games-on-whales/wolf CMakeLists.txt#L38-L45 Wraps FetchContent(reflect-cpp) with -w.
munich-data-engineering/sqlgen CMakeLists.txt#L75-L78 Compiles with -Wall -Wextra -Wpedantic.
openmoq/moqx CMakeLists.txt#L351 Enforces strict warning flags across translation units.
FANUC-CORPORATION/fanuc_driver CMakeLists.txt#L17 Enables -Wall -Wextra -Wpedantic.

Testing

  • Header-only warning cleanup verified with -Wall -Wextra -Werror -Wsign-conversion -Wextra-semi and the existing test suite.

clockblocker added a commit to clockblocker/reflect-cpp that referenced this pull request Dec 1, 2026
… -Wunused-parameter warnings

Cleans compiler warnings across 14 public headers (+22/-18 LOC) using unnamed
unused parameters (matching munich-data-engineering#582) with zero API or behavioral changes so
consumers building with strict flags (`-Wall -Wextra -Werror -pedantic
-Wconversion -Wsign-conversion -Wextra-semi`) get clean builds.

Upstream PR: munich-data-engineering#803
Downstream receipts:
- hudson-trading/slang-server suppresses reflect-cpp warnings in 4 places:
  https://github.com/hudson-trading/slang-server/blob/1b413a4655877a55b3f8a450c23e4ba6c2bf4267/CMakeLists.txt#L317-L321
- games-on-whales/wolf wraps FetchContent(reflect-cpp) with `add_compile_options(-w)`:
  https://github.com/games-on-whales/wolf/blob/ac2461f68feda41fdc7a7c8e812b9ab4b80520b7/src/moonlight-server/CMakeLists.txt#L38-L45
- munich-data-engineering/sqlgen, openmoq/moqx, and FANUC-CORPORATION/fanuc_driver
  all compile with `-Wall -Wextra -Wpedantic`.

This branch has not been deployed

No deployments
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.

1 participant