Chet Ramey <[email protected]> writes:

>> You can probably just add a check add something like:
>>      if (bytes < PTRDIFF_MAX)
>>        {
>>           errno = ENOMEM;
>>           return NULL;
>>        }
>> to silence it (although I haven't tested it).
>
> I hate adding code just to silence spurious warnings.

I don't blame you. I should have mentioned that the example was more-so
an explanation of what the warning was about. The message is not too
helpful, in my opinion.

It seems the OP is using special compiler options (which is a perfectly
reasonable way to hunt for bugs), since I do not see these warnings by
default with GCC 15 on Fedora.

Because of that, I think these are fine to ignore.

Collin

Reply via email to