compiler-warnings (C/C++): -Wshadow=global is -Wshadow, -Weverything includes everything, -Wno-pedantic negates warning_level's -Wpedantic; "found" and "missing" lines contradict
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 領域
- build-system, tooling
研究方向
Start with the compiler-warnings check in the validator's Python source, looking at how it matches flag names such as -Wshadow and how it builds the "missing" and "found" messages. Reproduce the three cases from the corpus entries for nlohmann/json, fmtlib/fmt and GNOME/glib under corpus/. Done when -Wshadow=global, -Weverything and -Wno-pedantic are handled correctly and the fmt messages no longer contradict each other.
由索引模型根據 Issue 內容生成。
描述
nlohmann/json: FAIL "missing -Wshadow" though GCC gets -Wshadow=global/-Wshadow=local and Clang -Weverything; glib: -Wpedantic credited from Meson warning_level=3 although the project adds -Wno-pedantic; fmt: "missing -Wshadow for gcc; /W4 for msvc" directly above "found -Wall -Wextra -Wpedantic -Wshadow -Wconversion /W4" (per-compiler conditions not reflected in the wording).
Evidence from the corpus audit
nlohmann/json / compiler-warnings
- kind: FALSE_NEGATIVE
- actual: FAIL: "C/C++: missing compiler warning flags: -Wshadow for appleclang and clang and gcc and intel"
("found -Wall -Wextra -Wpedantic -Wconversion /W4 /permissive-") - expected: PASS for C/C++: GCC gets
-Wshadow=global(a superset spelling of-Wshadow) and-Wshadow=local,
Clang/AppleClang get-Weverything, which includes -Wshadow and every other warning. - evidence: cmake/gcc_flags.cmake:281-283:
-Wshadow=compatible-local/-Wshadow=global/-Wshadow=local;
cmake/clang_flags.cmake:16-18:set(CLANG_CXXFLAGS/-Werror/-Weverything; cmake/ci.cmake:80-81:
include(clang_flags)/include(gcc_flags)(theci_test_gcc/ci_test_clangtargets CI builds via
.github/workflows/ubuntu.yml:32run: cmake --build build --target ci_test_gcc). The validator already credits
-Wpedantic/-Wconversionfrom these same files, so it reads them; it just matches-Wshadowliterally. - repro:
target_compile_options(t PRIVATE -Wall -Wextra -Wpedantic -Wshadow=global -Wconversion)for gcc and
-Weverythingfor clang; expect PASS. - confidence: high
fmtlib/fmt / compiler-warnings
- kind: MESSAGE
- actual: FAIL: "missing compiler warning flags: -Wshadow for gcc; /W4, /permissive- for msvc" and on the next line
"found -Wall -Wextra -Wpedantic -Wshadow -Wconversion" - expected: the status is right (GCC < 5 and MSVC
/W3lack them) but the two lines contradict each other; say
"-Wshadow for gcc only when CMAKE_CXX_COMPILER_VERSION >= 5.0" or list "found" per compiler. - evidence: CMakeLists.txt:180-189:
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)/set(PEDANTIC_COMPILE_FLAGS
...-Wshadow); :212 (Clang branch)-Wshadow; :225:set(PEDANTIC_COMPILE_FLAGS /W3). - repro:
-Wshadowadded only under aVERSION_LESScondition; expect the message to name the condition. - confidence: medium
GNOME/glib / compiler-warnings
- kind: FALSE_POSITIVE
- actual: FAIL: "... missing compiler warning flags: -Wshadow, -Wconversion ..." with detail "C/C++: found -Wall -Wextra -Wpedantic /W4"
- expected:
-Wpedanticshould not be credited:warning_level=3implies it, but the project adds-Wno-pedanticexplicitly. - evidence:
meson.build:7:'warning_level=3',;meson.build:608-610:# Due to function casts through (void*) we cannot support -Wpedantic:/# ./docs/toolchain-requirements.md#Function_pointer_conversions./'-Wno-pedantic',. - repro:
project('x', 'c', default_options: ['warning_level=3'])+add_project_arguments('-Wno-pedantic', language: 'c'). - confidence: medium
Found by the regression-corpus audit (235 real repositories, one or more per ecosystem profile; corpus and expected results in corpus/). Evidence is quoted from the audited checkouts at the commits pinned in corpus/projects.toml; <checkouts>/<owner>__<repo> is such a checkout.
🤖 Generated with Claude Code
- 主要語言
- Python
- 星號
- 4
- 分支
- 1
- 平均合併
- 10 小時 41 分鐘
- 30 天內合併 PR
- 79
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
cpp-best-practices/project_validator 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
cpp-best-practices/project_validator#267 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
cpp-best-practices/project_validator#263 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
cpp-best-practices/project_validator#260 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
cpp-best-practices/project_validator#259 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
cpp-best-practices/project_validator#255 ·
維護者通常 1 天內回覆
查看 cpp-best-practices/project_validator 的全部 Issue
相似的 Issue
-
documentation type/bug
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"可能已有人在做 @0z5a 今天認領。 未關閉needs-triage
難度 2/5 半天 新手友好度 72/100
維護者通常 2 天內回覆
-
trace: Pi's 1-hour cache writes are priced at 1.25x, but billed at 2x可能已有人在做 @Shizoqua 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
microsoft/TokenEconomizer#221 ·
維護者通常 1 天內回覆
-
plot_graph crashes when a mesh node has no m2m edge可能已有人在做 @tygvi 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
mllam/neural-lam#883 · 1 則留言 ·
維護者通常 2 天內回覆