https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128343

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <[email protected]>:

https://gcc.gnu.org/g:bf136cb5649057a3f6b76e8a7f446cc499a9d1ed

commit r17-5986-gbf136cb5649057a3f6b76e8a7f446cc499a9d1ed
Author: Harald Anlauf <[email protected]>
Date:   Tue Nov 3 23:19:53 2026 +0100

    fortran: Fix treatment of UTF-8 byte order marks in source files [PR128343]

    When a gfortran source file contains a BOM, we ignore it, but only on the
    first line of a file.  In that case the temporary line buffer needs to be
    extended to avoid valgrind errors.

            PR fortran/128343

    gcc/fortran/ChangeLog:

            * scanner.cc (load_line): Check for optional UTF-8 BOM at beginning
            of line.  Adjust temporary line buffer length and line truncation.
            (load_file): Use it when reading the very first line of a source
            file.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/bom_UTF-8-2.f: New test.

Reply via email to