Re: [exim-dev] exim-4.83_RC2 - expand.c:1881:1: warning: con…

Etusivu
Poista viesti
Vastaa
Lähettäjä: Jeremy Harris
Päiväys:  
Vastaanottaja: exim-dev
Aihe: Re: [exim-dev] exim-4.83_RC2 - expand.c:1881:1: warning: control reaches end of non-void function
On 19/06/14 15:59, Eugene Istomin wrote:
> Hello,
>
> i'm trying to build exim-4.83_RC2 (i tried a released package & git head) on opensuse build service and discover some C-code errors:
>
> expand.c: In function 'find_variable':
> expand.c:1881:1: warning: control reaches end of non-void function [-Wreturn-type]


I do not see it as doing so. The trailing major component of the
function is a switch statement for which all possible cases are
given, if we assume that vp->type is never assigned anything
but one of the (unnamed) enum values vtype_*. Each of the switch
cases has, or falls though to, a return. There are no gotos in the
function.

I will agree that vp->type ought to be typed as the enum to
permit static checking of assignments to it, but I think
your compiler's analysis is lacking for this case.

> ...
> expand.c: In function 'eval_acl.constprop.3':
> expand.c:2004:9: warning: 'tmp' is used uninitialized in this function [-Wuninitialized]


Can you point to exactly how? I'm not seeing it.

The variable "tmp" is assigned at the top of the first for-loop
body and used at the end of the same loop body. It's address
is used once later in the function. There are no other uses.


> This errors leads to unsuccessfull post-build lint:
>
>   I: Program is using uninitialized variables.
>     Note the difference between "is used" and "may be used"
> W: exim uninitialized-variable expand.c:2004


As above.

>
> I: Program returns random data in a function
> E: exim no-return-in-nonvoid-function expand.c:1881
>
> I: Program returns random data in a function
> E: exim no-return-in-nonvoid-function expand.c:1881


As above.

>
> So, expand.c:1881 generate an error and build was failed.


I think your tools are in error.
-- 
Cheers,
    Jeremy