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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-01-14
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=81437
     Ever confirmed|0                           |1
      Known to fail|                            |7.3.0, 8.2.0, 9.0

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC 8.2.0 and 9 issue two warnings, one for each of fcst and frng, but none for
gcst or grng, so confirming those are still missing.

See also bug 81437 for a similar (the same?) problem.

$ gcc -O2 -S -Wall z.c
z.c: In function ‘fcst’:
z.c:5:3: warning: array subscript 3 is above array bounds of ‘char[2]’
[-Warray-bounds]
   __builtin_strcpy (d, a + 3);   // -Warray-bounds (good)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
z.c:5:3: warning: ‘__builtin_strcpy’ offset 3 is out of the bounds [0, 2] of
object ‘a’ with type ‘char[2]’ [-Warray-bounds]
z.c:3:8: note: ‘a’ declared here
   char a[2] = "0";
        ^
z.c: In function ‘frng’:
z.c:16:3: warning: ‘__builtin_strcpy’ offset [3, 2147483647] is out of the
bounds [0, 2] of object ‘a’ with type ‘char[2]’ [-Warray-bounds]
   __builtin_strcpy (d, a + i);   // both warnings missing
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
z.c:11:8: note: ‘a’ declared here
   char a[2] = "0";
        ^

Reply via email to