[Bug]: build-ss3-warnings only counts gcc source lines numbered 1000-9999
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 78/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 領域
- build-system, ci-cd, testing
研究方向
Start with build-ss3-warnings.yml lines 76-95 and the warnings.txt layout from run 36063469992; inspect how the R step extracts and compares warning counts. Reproduce the existing CI command with the listed unused-variable cases, then verify that the baseline passes and each warning reaches the expected failure path.
由索引模型根據 Issue 內容生成。
描述
Describe the bug
build-ss3-warnings.yml:79 (at 82f92f7) counts warnings with grep(pattern = "^ [0-9]", x = txt). gcc right-aligns line numbers in a 5-character field, so only source lines numbered 1000-9999 match: grepl("^ [0-9]", c(" 121 |", " 1947 |", "17560 |")) is FALSE TRUE FALSE. In the generated ss3.cpp (40,109 lines), 1000-9999 is DATA_SECTION code and FUNCTIONs start at line 16627. A new unused-variable warning in a FUNCTION passes the job with "Acceptable number of warnings: 0".
A counted warning fails the step on n_warn[1,1] applied to an integer (line 88, incorrect number of dimensions), not on the stop() at line 91. Line 95 reduces to n_warn < 0, so "decreased" never prints.
To Reproduce
I ran ADMB 13.2 tpl2cpp on 82f92f7, added one unused int per case to the tpl sources, compiled with the CI command under g++ 16.2, put the output into the warnings.txt layout from run 36063469992, and ran the R step unchanged:
| unused variable added in | ss3.cpp line | gcc warnings | job |
|---|---|---|---|
| nothing (baseline) | - | 0 | pass, count 0 |
SS_readdata_330.tpl LOCAL_CALCS |
1947 | 1 | fails on the R error |
get_natmort() |
17560 | 1 | pass, count 0 |
write_msg() in GLOBALS |
121 | 1 | pass, count 0 |
The -Wmisleading-indentation warning quoted in #561 (ss.cpp:34714) also passes. Counting ": warning:" lines instead counts each of these. Debian gcc 12.2 (C front end) prints the same margins; the CI image johnoel/admb-13.2:linux was not run. The latest run (36063469992) had no gcc warnings.
Expected behavior
Any new warning in SS3 code fails the job with "Increased number of warnings".
Which OS are you seeing the problem on?
Linux
Which version of SS3 are you seeing the problem on?
main at 82f92f7
Additional Context
The regex came in with #561 (312b64c). Happy to open a PR that:
- counts
": warning:"lines; - starts at
warn_line+2: line 76 skips the first gcc line, which for a file-scope warning is the warning itself (an unusedstatic intat ss3.cpp:20 counted 0 with only the regex fixed); - drops lines 87-89;
- compares against the reference file's warning count instead of
length(ref), which is 3 (with only 1 and 3, one new warning passed).
With all four, the baseline passed and every warning above reached the stop().
- 主要語言
- C++
- 星號
- 46
- 分支
- 19
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
nmfs-ost/ss3-source-code 的其他 Issue
-
[Bug]: non-integer `Lbin_lo`/`Lbin_hi` are silently truncated under `Lbin_method = 1`, while method 3 raises a fatal error for the equivalent mistake可能已有人在做 @Rick-Methot-NOAA 於 6 天前認領。 未關閉
nmfs-ost/ss3-source-code#784 · 已指派 1 人 ·
-
need warning and improved logic for generalized sizecomp可能重新可做 @Rick-Methot-NOAA 於 241 天前認領,目前沒有進行中的 PR。 未關閉composition in progress
nmfs-ost/ss3-source-code#751 · 1 則留言 · 已指派 1 人 ·
-
[Feature]: Add standard errors for area-specific quantities可能重新可做 @Rick-Methot-NOAA 於 379 天前認領,目前沒有進行中的 PR。 未關閉area & movement
nmfs-ost/ss3-source-code#731 · 3 則留言 · 已指派 1 人 ·
-
[Feature]: Create a basic report list that could serve as better starting configuration for customization可能重新可做 @Rick-Methot-NOAA 於 386 天前認領,目前沒有進行中的 PR。 未關閉misc. output
nmfs-ost/ss3-source-code#723 · 已指派 1 人 ·
-
[Feature]: restrict biology output using the use_morph(g) flag可能重新可做 @Rick-Methot-NOAA 於 408 天前認領,目前沒有進行中的 PR。 未關閉biology misc. output ongoing
nmfs-ost/ss3-source-code#702 · 已指派 1 人 ·
查看 nmfs-ost/ss3-source-code 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 85/100
microsoft/onnxruntime#33018 ·
維護者通常 2 天內回覆
-
難度 1/5 1 小時以內 新手友好度 78/100
維護者通常 1 天內回覆
-
customer-reported needs-triage question
難度 2/5 1-3 小時 新手友好度 76/100
Azure/azure-sdk-for-cpp#7435 ·
維護者通常 1 天內回覆
-
ChromieCraft Generic Confirmed World Event
難度 2/5 1-3 小時 新手友好度 68/100
azerothcore/azerothcore-wotlk#27882 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 82/100
aristocratos/btop#1874 ·
維護者通常 1 天內回覆