Skip to content

Commit 81b383b

Browse files
fix issue-75743
1 parent 2a6283d commit 81b383b

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

src/main/java/edu/hm/hafner/analysis/registry/Gcc4Descriptor.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,20 @@
1010
/**
1111
* A descriptor for the GNU C Compiler (gcc).
1212
*
13-
* Supports GCC version 4 and newer (modern GCC output).
14-
* For legacy GCC (<3), use the GCC3 parser.
13+
* <p>
14+
* Supports GCC version 4 and newer, including modern versions up to GCC 15+.
15+
* This parser handles the standard GCC output format introduced in GCC 4.
16+
* </p>
17+
*
18+
* <p>
19+
* For legacy GCC versions (pre-GCC 4), use the "gcc3" parser instead.
20+
* </p>
1521
*
1622
* @author Lorenz Munsch
1723
*/
1824
class Gcc4Descriptor extends CompositeParserDescriptor {
1925
private static final String ID = "gcc";
20-
private static final String NAME = "GNU C Compiler (GCC 4 and newer)";
26+
private static final String NAME = "GNU C Compiler (GCC)";
2127

2228
Gcc4Descriptor() {
2329
super(ID, NAME);
@@ -31,9 +37,9 @@ protected Collection<? extends IssueParser> createParsers() {
3137
@Override
3238
public String getHelp() {
3339
return "Parses warnings and errors generated by GCC version 4 and newer "
34-
+ "(including GCC 5–15). Use this parser for modern GCC compilers "
35-
+ "that output messages like:\n"
36-
+ "file.c:10:5: warning: unused variable ‘x’ [-Wunused-variable]\n\n"
37-
+ "For very old GCC (<3) logs, use the legacy GCC3 parser.";
40+
+ "(including GCC 5–15+). Use this parser for modern GCC compilers "
41+
+ "that output messages in the standard format like:\n"
42+
+ "file.c:10:5: warning: unused variable 'x' [-Wunused-variable]\n\n"
43+
+ "For very old GCC versions (pre-GCC 4), use the 'gcc3' parser instead.";
3844
}
3945
}

src/main/java/edu/hm/hafner/analysis/registry/GccDescriptor.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@
44
import edu.hm.hafner.analysis.parser.GccParser;
55

66
/**
7-
* A descriptor for GNU C Compiler 3 (gcc).
7+
* A descriptor for legacy GNU C Compiler (gcc) versions older than GCC 4.
8+
*
9+
* <p>
10+
* This parser is designed for very old GCC compilers (pre-GCC 4) that use a
11+
* different
12+
* output format. For modern GCC versions (4 and newer, including GCC 5–15), use
13+
* the
14+
* "gcc" parser instead.
15+
* </p>
816
*
917
* @author Lorenz Munsch
1018
*/
1119
class GccDescriptor extends ParserDescriptor {
1220
private static final String ID = "gcc3";
13-
private static final String NAME = "GNU C Compiler 3 (gcc)";
21+
private static final String NAME = "GNU C Compiler (Legacy, pre-GCC 4)";
1422

1523
GccDescriptor() {
1624
super(ID, NAME);
@@ -20,4 +28,13 @@ class GccDescriptor extends ParserDescriptor {
2028
public IssueParser create(final Option... options) {
2129
return new GccParser();
2230
}
31+
32+
@Override
33+
public String getHelp() {
34+
return "Parses warnings and errors from legacy GCC compilers (versions older than GCC 4). "
35+
+ "This parser uses an older, simpler warning format.\n\n"
36+
+ "For modern GCC versions (GCC 4 and newer, including GCC 5–15), use the 'gcc' parser instead, "
37+
+ "which supports the newer format with additional context like:\n"
38+
+ "file.c:10:5: warning: unused variable 'x' [-Wunused-variable]";
39+
}
2340
}

0 commit comments

Comments
 (0)