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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Again, component=diagnostics is not for reporting false positive warnings:

  A bug relating to the "gcc/diagnostics" subdirectory of the source tree: the
shared
  code implementing diagnostics (text output, SARIF output, source quoting,
etc). Bugs
  relating to specific diagnostics should instead use the component emitting
them,
  and have the "diagnostic" keyword set.'

I agree that the warning seems correct here. There is no situation when reading
-1zu bytes will be correct, so it's not a good argument to memchr. The content
of the string is not relevant to the warning. If you really want to pass that
value, you can suppress the warning with diagnostic pragmas.

Reply via email to