> > The code is already safe.
> It is reasonably safe(*) and triggers a warning. That's a good reason
> to silence the warning.

No.

The warning is a false extension to C.

In C, int and sizeof can be compared safely in this circumstance.

> Otherwise people might fall into a habit
> of ignoring warnings [that may point to actual problems].

People might fall into the habit of ignoring a warning from an
extension to C provided by a single compiler?

I doubt it.

> I just pointed out a safe way to silence the warning, without it
> potentially blowing up in a changed world.

There is no point in silencing the warning, since the warning is
from an extension to C which is bullshit.

> (*) looking at POSIX, snprintf is not required to return -1,
> but only "a negative value".  So it's not truly safe either way.

It cannot occur in this code in any case.


You are barking up the wrong tree.

Otherwise, you can start enabling that option and sending a diff which
fixes ALL THE WARNINGS IT GIVES IN THE ENTIRE TREE.

Which we will gladly delete also.

Because the tree is written in C, and C allows that idiom, because it
is safe.

Reply via email to