Skip to content

Commit 28bd50e

Browse files
Implement -Wcall-params (#353)
1 parent eed1e3a commit 28bd50e

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

cobj/warning-help.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ CB_WARNDEF (cb_warn_constant, "constant", 1,
3838
CB_WARNDEF (cb_warn_parentheses, "parentheses", 1,
3939
N_("Warn lack of parentheses around AND within OR"))
4040

41+
CB_WARNDEF (cb_warn_call_params, "call-params", 0,
42+
N_("Warn non 01/77 items for CALL params"))
43+
4144
CB_WARNDEF (cb_warn_column_overflow, "column-overflow", 0,
4245
N_("Warn text after column 72, FIXED format"))
4346

tests/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ command_line_options_DEPENDENCIES = \
154154
command-line-options.src/Wredefinition.at \
155155
command-line-options.src/Wconstant.at \
156156
command-line-options.src/Wparentheses.at \
157+
command-line-options.src/Wcall-params.at \
157158
command-line-options.src/Wcolumn-overflow.at \
158159
command-line-options.src/Wterminator.at \
159160
command-line-options.src/Wunreachable.at \

tests/Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ command_line_options_DEPENDENCIES = \
695695
command-line-options.src/Wredefinition.at \
696696
command-line-options.src/Wconstant.at \
697697
command-line-options.src/Wparentheses.at \
698+
command-line-options.src/Wcall-params.at \
698699
command-line-options.src/Wcolumn-overflow.at \
699700
command-line-options.src/Wterminator.at \
700701
command-line-options.src/Wunreachable.at \

tests/command-line-options.at

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ m4_include([Wobsolete-Warchaic.at])
1313
m4_include([Wredefinition.at])
1414
m4_include([Wconstant.at])
1515
m4_include([Wparentheses.at])
16+
m4_include([Wcall-params.at])
1617
m4_include([Wcolumn-overflow.at])
1718
m4_include([Wterminator.at])
1819
m4_include([Wunreachable.at])
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
AT_SETUP([-Wcolumn-overflow])
2+
3+
AT_DATA([callee.cbl],
4+
[ IDENTIFICATION DIVISION.
5+
PROGRAM-ID. callee.
6+
DATA DIVISION.
7+
WORKING-STORAGE SECTION.
8+
LINKAGE SECTION.
9+
01 GRP1.
10+
03 P1 PIC X(5).
11+
01 GRP2.
12+
03 P2 PIC X(5).
13+
77 P3 PIC X(5).
14+
PROCEDURE DIVISION USING P1 GRP2 P3.
15+
DISPLAY P1.
16+
])
17+
18+
AT_CHECK([${COBJ} -Wcall-params callee.cbl], [1], [],
19+
[callee.cbl:11: Error: 'P1' not level 01 or 77
20+
])
21+
22+
AT_CHECK([${COBJ} --help | grep '\-Wcall-params' > /dev/null], [0])
23+
24+
AT_CLEANUP

0 commit comments

Comments
 (0)