Skip to content

fix: suppress compilation warnings from vendored third-party headers#1113

Merged
frankslin merged 1 commit intomasterfrom
copilot/fix-excessive-compilation-warnings
Apr 15, 2026
Merged

fix: suppress compilation warnings from vendored third-party headers#1113
frankslin merged 1 commit intomasterfrom
copilot/fix-excessive-compilation-warnings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 15, 2026

All build warnings originated from deps/rapidjson-1.1.0/rapidjson/document.h (deprecated std::iterator and memcpy on non-trivially-copyable types), triggered by src/Config.cpp including it. The warnings were artifacts of the vendored library's age against C++17, not OpenCC code.

Change

In src/CMakeLists.txt, mark all deps/ include directories with CMake's SYSTEM keyword:

# Before
include_directories(../deps/rapidjson-1.1.0)

# After
include_directories(SYSTEM ../deps/rapidjson-1.1.0)

Applied to rapidjson, marisa, tclap, and darts-clone. The SYSTEM flag causes the compiler to use -isystem instead of -I, which suppresses diagnostics from those headers on GCC, Clang, and MSVC — the standard CMake mechanism for silencing third-party warnings without touching dep sources or broad project-level flag suppression.

@frankslin frankslin marked this pull request as ready for review April 15, 2026 06:36
@frankslin frankslin merged commit 5780856 into master Apr 15, 2026
35 checks passed
@frankslin frankslin deleted the copilot/fix-excessive-compilation-warnings branch April 15, 2026 06:47
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.

2 participants