[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gmp-bugs
Subject:    found a bug in gmp-4.2.4
From:       vincent () vinc17 ! org (Vincent Lefevre)
Date:       2009-03-23 9:53:00
Message-ID: 20090323095300.GT22844 () prunille ! vinc17 ! org
[Download RAW message or body]

On 2009-03-23 09:51:31 +0100, Torbjorn Granlund wrote:
> "Martin Ettl" <ettl.martin at gmx.de> writes:
> [./mpz/export.c:66]: (error) Wrong assignement of an auto-variable to an effective \
> parameter of a function 
> The code, the code analysis tool complains about:
> if (countp == NULL)
> countp = &dummy;
> 
> I believe cppcheck is wrong.  If somebody agrees with cppcheck, please
> explain to me what is wrong with the code.

I also believe that it is wrong. If "T **p" is a parameter, then

  *p = &something_of_type_T;

could be wrong (even though one doesn't try to read at this address
after the function has returned, but just does some evaluation of
the pointer), but this is not the case here.

-- 
Vincent Lef?vre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic