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

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Eugene Istomin
Dátum:  
Címzett: exim-dev
Tárgy: Re: [exim-dev] exim-4.83_RC2 - expand.c:1881:1: warning: control reaches end of non-void function
Hello,

patch like:

--- src/expand.c    2014-06-20 15:40:24.000000000 +0300
+++ src/expand.c.new    2014-06-22 08:54:16.820647300 +0300
@@ -1878,6 +1878,7 @@
   #endif


   }
+  return;         
 }



resolve lint check "no-return-in-nonvoid-function"

/---/
*/Best regards,/*
/Eugene Istomin/
/EDS Systems/
/E.Istomin@???/
/Work: +372-6409-600/


> 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.