[Bug fortran/118793] request NAMELIST reports of input errors indicate position of error and show line containing error
"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]> Mon, 03 Aug 2026 20:58:25 +0000
| Newsgroups | gmane.comp.gcc.bugs |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D118793 --- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jerry DeLisle <[email protected]>: https://gcc.gnu.org/g:86b7458e072b0651f8b04bcba64f5e2d1586bdec commit r17-2906-g86b7458e072b0651f8b04bcba64f5e2d1586bdec Author: Jerry DeLisle <[email protected]> Date: Tue Jul 28 19:02:36 2026 -0700 fortran: [PR118793] Additional expanded namelist read diagnostics These changes add expanded diagnostics to error locations not addressed in the original patch. This is done by using a new helper function that saves the error message information for namelist related errors in a buffer and keeping a status bit in the st_parameter_dt structure. PR libfortran/118793 libgfortran/ChangeLog: * io/io.h (NML_ERR_MSG_LEN): New macro. (st_parameter_dt): Add nml_err_pending bit. (gfc_unit): Add nml_err_msg. * io/list_read.c (nml_error): New function. (eat_separator): Use new function (convert_integer): Likewise. (convert_unsigned): Likewise. (parse_repeat): Likewise. Save the position where the repeat count starts and report it. (read_logical): Likewise. (read_integer): Likewise. (parse_real): Likewise. (read_complex): Likewise. (read_real): Likewise. (check_type): Likewise. (list_formatted_read_scalar): Likewise. (read_character): Likewise. Save the initial position of the v= alue (nml_read_obj): Unwind to nml_err_ret on a deferred error. (namelist_read): Store deferred errors in the unit's nml_err_msg buffer. gcc/testsuite/ChangeLog: * gfortran.dg/namelist_101.f90: Fix dg-do directive typo and check the expanded diagnostic. * gfortran.dg/namelist_104.f90: New test.=