diff --git a/cobj/warning-help.def b/cobj/warning-help.def index 6a4ad940..27f8ef53 100644 --- a/cobj/warning-help.def +++ b/cobj/warning-help.def @@ -38,6 +38,9 @@ CB_WARNDEF (cb_warn_constant, "constant", 1, CB_WARNDEF (cb_warn_parentheses, "parentheses", 1, N_("Warn lack of parentheses around AND within OR")) +CB_WARNDEF (cb_warn_call_params, "call-params", 0, + N_("Warn non 01/77 items for CALL params")) + CB_WARNDEF (cb_warn_column_overflow, "column-overflow", 0, N_("Warn text after column 72, FIXED format")) diff --git a/tests/Makefile.am b/tests/Makefile.am index 2ebeb813..a26738a6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -154,6 +154,7 @@ command_line_options_DEPENDENCIES = \ command-line-options.src/Wredefinition.at \ command-line-options.src/Wconstant.at \ command-line-options.src/Wparentheses.at \ + command-line-options.src/Wcall-params.at \ command-line-options.src/Wcolumn-overflow.at \ command-line-options.src/Wterminator.at \ command-line-options.src/Wunreachable.at \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 43c506de..7dc83d5b 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -695,6 +695,7 @@ command_line_options_DEPENDENCIES = \ command-line-options.src/Wredefinition.at \ command-line-options.src/Wconstant.at \ command-line-options.src/Wparentheses.at \ + command-line-options.src/Wcall-params.at \ command-line-options.src/Wcolumn-overflow.at \ command-line-options.src/Wterminator.at \ command-line-options.src/Wunreachable.at \ diff --git a/tests/command-line-options.at b/tests/command-line-options.at index 0a5c172a..f9af0506 100644 --- a/tests/command-line-options.at +++ b/tests/command-line-options.at @@ -13,6 +13,7 @@ m4_include([Wobsolete-Warchaic.at]) m4_include([Wredefinition.at]) m4_include([Wconstant.at]) m4_include([Wparentheses.at]) +m4_include([Wcall-params.at]) m4_include([Wcolumn-overflow.at]) m4_include([Wterminator.at]) m4_include([Wunreachable.at]) diff --git a/tests/command-line-options.src/Wcall-params.at b/tests/command-line-options.src/Wcall-params.at new file mode 100644 index 00000000..3c1c8f51 --- /dev/null +++ b/tests/command-line-options.src/Wcall-params.at @@ -0,0 +1,24 @@ +AT_SETUP([-Wcolumn-overflow]) + +AT_DATA([callee.cbl], +[ IDENTIFICATION DIVISION. + PROGRAM-ID. callee. + DATA DIVISION. + WORKING-STORAGE SECTION. + LINKAGE SECTION. + 01 GRP1. + 03 P1 PIC X(5). + 01 GRP2. + 03 P2 PIC X(5). + 77 P3 PIC X(5). + PROCEDURE DIVISION USING P1 GRP2 P3. + DISPLAY P1. +]) + +AT_CHECK([${COBJ} -Wcall-params callee.cbl], [1], [], +[callee.cbl:11: Error: 'P1' not level 01 or 77 +]) + +AT_CHECK([${COBJ} --help | grep '\-Wcall-params' > /dev/null], [0]) + +AT_CLEANUP