https://gcc.gnu.org/g:64f2dcffc34274ac9877630d33d776745952a90a
commit r17-4435-g64f2dcffc34274ac9877630d33d776745952a90a Author: Xavier Del Campo Romero <[email protected]> Date: Thu Sep 17 23:20:29 2026 +0200 cobol: Show location for invalid arg in CALL Previously, in such situation gcobol would print the location for the PROCEDURE DIVISION where the mismatch occurred, rather than the actual location of the invalid argument. For example: Before: argloc.cbl:8:55: error: parameter 2 BY VALUE ‘0’ (NUMERIC LITERAL, capacity 1, unsigned) invalid for ‘foo’ parameter BY REFERENCE ‘param-b’ (COMPUTATIONAL-5, capacity 4, signed) 8 | procedure division using param-a by reference param-b. | ^~~~~~~~ Now: argloc.cbl:18:37: error: parameter 2 BY VALUE ‘0’ (NUMERIC LITERAL, capacity 1, unsigned) invalid for ‘foo’ parameter BY REFERENCE ‘param-b’ (COMPUTATIONAL-5, capacity 4, signed) 18 | by value 0. | ^~ gcc/cobol/ChangeLog: * parse.y: Show location for invalid arg in CALL. Diff: --- gcc/cobol/parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y index 0552f77f6193..24b870f8dd68 100644 --- a/gcc/cobol/parse.y +++ b/gcc/cobol/parse.y @@ -13103,7 +13103,7 @@ verify_args( const YYLTYPE& loc, */ if( ord < narg ) { if( ord < formals.size() ) { - error_msg( loc, "parameter %zu %s %qs (%s, capacity %u, %s) " + error_msg( parg->refer.loc, "parameter %zu %s %qs (%s, capacity %u, %s) " "invalid for %qs parameter %s %qs (%s, capacity %u, %s)", 1 + ord, passby_str(parg->crv),
