Skip to content

cmake: keep strict-prototypes on C flags#2735

Open
Old-Ding wants to merge 1 commit into
Azure:mainfrom
Old-Ding:fix/strict-prototypes-c-only
Open

cmake: keep strict-prototypes on C flags#2735
Old-Ding wants to merge 1 commit into
Azure:mainfrom
Old-Ding:fix/strict-prototypes-c-only

Conversation

@Old-Ding

@Old-Ding Old-Ding commented Jul 5, 2026

Copy link
Copy Markdown

Summary

  • Keep -Wstrict-prototypes on C compiler flags only.

Details

The strict_prototypes option enables GCC/Clang's -Wstrict-prototypes, which is a C-only diagnostic. The current CMake logic appends it to both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS, so enabling the option also passes a C-only warning flag to C++ targets.

This leaves the C behavior unchanged and avoids adding the C-only option to C++ compiler invocations.

Testing

  • git diff --check HEAD~1..HEAD
  • Reviewed the strict_prototypes CMake option path and C++ test/sample targets that consume CMAKE_CXX_FLAGS.

Not run: local CMake configure/build, because this Windows environment does not have cmake or a C/C++ compiler installed.

Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
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