On 16 December 2014 at 10:50, Stuart Haslam <[email protected]> wrote:
> On Mon, Dec 15, 2014 at 08:15:03PM +0000, Mike Holmes wrote:
>> Logic error     Assigned value is garbage or undefined  odp_linux.c     185  
>>    8       View 
>> Report<http://docs.opendataplane.org/clang-scan/report-1a7998.html#EndPath>
>
> This is a false positive, status is initialised in wait(). I guess
> clang-check could be made happy by explicitly initialising it, but
> it's not needed and would probably cause some other tool to complain,
> so I'd just ignore it.
Would it help if variables were declared as close to their usage as
possible instead of being declared on the outermost function level?
int i;
for (i = 0; i < num; i++) {
    int j;
    int status;
    pid_t pid = wait(&status);

etc.

This function returns -1 for some error cases. Are those error cases
expected to occur in normal successful execution? I don't think so.
Better to call ODP_ABORT() and not return.


>
>> Logic error     Assigned value is garbage or undefined  odp_packet_io.c 488  
>>    10      View 
>> Report<http://docs.opendataplane.org/clang-scan/report-befe4a.html#EndPath>
>>
>
> This one was also found by coverity and there's a fix pending from Maxim.
>
>>
>> http://docs.opendataplane.org/clang-scan/index.html
>>
>>
>>
>> --
>> Mike Holmes
>> Linaro  Sr Technical Manager
>> LNG - ODP
>
> --
> Stuart.
>
>
> _______________________________________________
> lng-odp mailing list
> [email protected]
> http://lists.linaro.org/mailman/listinfo/lng-odp

_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to