[libvirt] [PATCH] virFork: placate static analyzers: ignore pthread_sigmask return value

Jim Meyering jim at meyering.net
Fri Feb 19 18:18:18 UTC 2010


Laine Stump wrote:
> On 02/19/2010 12:41 PM, Jim Meyering wrote:
>> Since we check all other uses of pthread_sigmask, be consistent
>> and clear: mark that we're deliberately ignoring this one.
>
> Ah, right. I didn't think of that (and my compiler didn't
> complain. What target didn't I run / cflag didn't I set? I know you
> sent mail about it awhile back, but I'm not firing on enough cylinders
> right now to go looking for it ;-))

That was reported by coverity.
I don't know if clang could detect it.

gcc currently doesn't do enough static analysis to notice that,
but could be made to warn if we gave that function the
warn_unused_result attribute.  Though in this case, it's really
not important.  No harm in ignoring, since the only possible failure
appears to be EINVAL, which you'd get for passing it an invalid arg.
I wrote the patch solely to suppress the false-positive warning.




More information about the libvir-list mailing list