Skip to content

Fix typo: MY_CXX_WARNING_FLGAS -> MY_CXX_WARNING_FLAGS in Cpp CMakeLists.txt - #4961

Open
arimu1 wants to merge 1 commit into
antlr:devfrom
arimu1:fix/4864-cxx-warning-flags-typo
Open

Fix typo: MY_CXX_WARNING_FLGAS -> MY_CXX_WARNING_FLAGS in Cpp CMakeLists.txt#4961
arimu1 wants to merge 1 commit into
antlr:devfrom
arimu1:fix/4864-cxx-warning-flags-typo

Conversation

@arimu1

@arimu1 arimu1 commented Jul 24, 2026

Copy link
Copy Markdown

Fixes #4864.

What

runtime/Cpp/CMakeLists.txt has two occurrences of a misspelled variable
reference, MY_CXX_WARNING_FLGAS, in the CMAKE_CXX_FLAGS_RELEASE lines
(one in the MSVC branch, one in the non-MSVC branch). The correctly spelled
variable is MY_CXX_WARNING_FLAGS.

This PR corrects both occurrences to MY_CXX_WARNING_FLAGS.

Why this is purely cosmetic

Since MY_CXX_WARNING_FLGAS was never defined, it silently expanded to
nothing in the set(CMAKE_CXX_FLAGS_RELEASE ...) lines — it did not cause a
build error. It also does not mean Release builds compile without
warning flags: line 89 (set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_WARNING_FLAGS}")) already appends the warning flags to the base
CMAKE_CXX_FLAGS, and CMake concatenates CMAKE_CXX_FLAGS with the
per-config CMAKE_CXX_FLAGS_<CONFIG> variable when invoking the compiler.
So warning flags were already applied in Release builds through that path;
the typo only dropped a redundant second copy of the same flags being
appended a second time in the Release-specific line.

Notes

  • Fixing the typo consistent with the correctly-spelled usage elsewhere in
    the same file (Debug, MinSizeRel, and RelWithDebInfo lines already use
    MY_CXX_WARNING_FLAGS correctly).
  • No behavioral test added — this is a build-file wording/typo fix with no
    observable behavior change.
  • A prior PR for the same issue, misspelled flag name MY_CXX_WARNING_FLGAS #4865, was opened and self-closed by the
    reporter without merging (it appears to have been opened from a branch
    literally named dev, against this repo's contribution guidelines). The
    typo is still present on current dev, so this PR supersedes it.

…sts.txt

Two set() calls for CMAKE_CXX_FLAGS_RELEASE (MSVC and non-MSVC
branches) referenced the misspelled variable MY_CXX_WARNING_FLGAS
instead of MY_CXX_WARNING_FLAGS. Since the misspelled variable was
never defined, it expanded to nothing, silently dropping a redundant
second copy of the warning flags (CMAKE_CXX_FLAGS already carries
MY_CXX_WARNING_FLAGS via line 89, so warnings are still applied in
Release builds).

Fixes antlr#4864

Signed-off-by: arimu1 <19286898+arimu1@users.noreply.github.com>
@arimu1

arimu1 commented Aug 1, 2026

Copy link
Copy Markdown
Author

C++ typo-only change (MY_CXX_WARNING_FLGASMY_CXX_WARNING_FLAGS). Rebased onto current dev.

Note: the red TypeScript build jobs look unrelated to this one-line CMake fix (cpp/java/js jobs green). Happy to dig if maintainers want, or they can ignore for this PR.

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.

misspelled flag name MY_CXX_WARNING_FLGAS

1 participant