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

--- Comment #8 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Looks like a faithful reduction that you made, it also still shows
the locale dependency from comment #4:

$ LANG="" gcc -O2 -S a.c
a.c: In function 'f':
a.c:18:6: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
   18 |   *d = '\0';
      |   ~~~^~~~~~
a.c:1:6: note: at offset 0 to object 'a' with size 4 declared here
    1 | char a[4];
      |      ^
$ LANG=de_DE.UTF-8  gcc -O2 -S a.c
a.c: In Funktion »f«:
a.c:18:6: Warnung: Schreiben von 140075679154576 Byte in eine Region der Größe
1 [-Wstringop-overflow=]
   18 |   *d = '\0';
      |   ~~~^~~~~~
a.c:1:6: Anmerkung: bei Offset 0 zum Objekt »a« mit Größe 4 wurde hier
deklariert
    1 | char a[4];
      |      ^

Reply via email to