https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119915
Bug ID: 119915
Summary: Sprintf1 repeats the entire format string if it starts
with a directive
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: modula2
Assignee: gaius at gcc dot gnu.org
Reporter: bruno at clisp dot org
Target Milestone: ---
Created attachment 61184
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61184&action=edit
test case prog.mod
The result of Sprintf1 is not right, when passed a format string that starts
with a directive.
How to reproduce:
$ gm2 prog.mod
$ ./a.out
Expected output:
---------------------------------------------
17
%u pieces of cake
16
2 pieces of cake
17
%u pieces of cake
---------------------------------------------
Actual output:
---------------------------------------------
17
%u pieces of cake
33
%u pieces of cake2 pieces of cake
17
%u pieces of cake
---------------------------------------------
Seen with gm2 (GCC) 15.0.1 20250323 (experimental).