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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <ga...@gcc.gnu.org>:

https://gcc.gnu.org/g:7a4f7a92770db4e739e76a06175454ba38d60b22

commit r16-107-g7a4f7a92770db4e739e76a06175454ba38d60b22
Author: Gaius Mulley <gaiusm...@gmail.com>
Date:   Thu Apr 24 11:15:18 2025 +0100

    PR modula2/119915: Sprintf1 repeats the entire format string if it starts
with a directive

    This bugfix is for FormatStrings to ensure that in the case of %x, %u the
    procedure function PerformFormatString uses Copy rather than Slice to
    avoid the case on an upper bound of zero in Slice.  Oddly the %d case
    had the correct code.

    gcc/m2/ChangeLog:

            PR modula2/119915
            * gm2-libs/FormatStrings.mod (PerformFormatString): Handle
            the %u and %x format specifiers in a similar way to the %d
            specifier.  Avoid using Slice and use Copy instead.

    gcc/testsuite/ChangeLog:

            PR modula2/119915
            * gm2/pimlib/run/pass/format2.mod: New test.

    Signed-off-by: Gaius Mulley <gaiusm...@gmail.com>

Reply via email to