Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Bug]: build-ss3-warnings only counts gcc source lines numbered 1000-9999

Abierto
#786 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
cpp, github-actions, r

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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:

  1. counts ": warning:" lines;
  2. starts at warn_line+2: line 76 skips the first gcc line, which for a file-scope warning is the warning itself (an unused static int at ss3.cpp:20 counted 0 with only the regex fixed);
  3. drops lines 87-89;
  4. 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().

Lenguaje dominante
C++
Estrellas
46
Forks
19
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nmfs-ost/ss3-source-code

Todos los issues de nmfs-ost/ss3-source-code

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.