[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fatal-signal: silence coverity warning

From: Bruno Haible
Subject: Re: [PATCH] fatal-signal: silence coverity warning
Date: Sat, 30 Apr 2011 02:23:52 +0200
User-agent: KMail/1.9.9

Eric Blake wrote:
> On a glibc system, Coverity gives this warning:
> Error: UNINIT:
> m4-1.4.16/lib/fatal-signal.c:183: var_decl: Declaring variable "action" 
> without initializer.
> m4-1.4.16/lib/fatal-signal.c:198: uninit_use_in_call: Using uninitialized 
> value "action": field "action".sa_restorer is uninitialized when calling 
> "sigaction".

The code in fatal-signal.c uses the standard idiom for invoking sigaction():
It initializes sa_handler, sa_flags, sa_mask and then calls sigaction(). Just
like the sample code in POSIX [1] does.

Therefore the code is fine, and you should look for a way to silence this
"error". Coverity appears to be a customizable product. So it must be
possible to tell it not to emit UNINIT errors for sa_restorer fields, no?
Like valgrind allows us hide some false "errors" through custom rules.

> you can argue that if you stick to just the POSIX-defined
> sa_flags values, then you can't trigger any extensions that
> would care about the contents of extension fields in the
> first place.



[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaction.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]