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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmalcolm at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Thomas Schwinge from comment #3)
>     [...]/c-c++-common/cpp/embed-1.c:191:14: warning: missing braces around
> initializer [-Wmissing-braces]

This is intentional.

>     [...]/c-c++-common/cpp/embed-1.c:255:8: warning: left-hand operand of
> comma expression has no effect [-Wunused-value]

These too.

>     [...]/c-c++-common/cpp/embed-1.c:319:52: warning: use of uninitialized
> value ‘meow_bytes[<unknown>]’ [CWE-457]
> [-Wanalyzer-use-of-uninitialized-value]
>       319 |     meow[i] = (meow_bytes[i * 2] << 8) | meow_bytes[i * 2 + 1];
>           |                                          ~~~~~~~~~~^~~~~~~~~~~

That looks like analyzer problem, I certainly don't see any uninit.

This is on
  const unsigned char meow_bytes[] = {
    #embed "embed-5.c"
  };
  short meow[sizeof (meow_bytes) / sizeof (short)] = {};
  for (int i = 0; i < (int) (sizeof (meow) / sizeof (short)); i++)
    meow[i] = (meow_bytes[i * 2] << 8) | meow_bytes[i * 2 + 1];
where meow_bytes should be 270 bytes long (at least unless somebody recodes the
line endings) and meow 135 shorts, and in GIMPLE
both arrays are fully initialized:
  meow_bytes = *.LC0;
  meow = {};
(.LC0 is those 270 bytes long) and the loop should iterate 135 times.

Reply via email to