found a bug in gmp-4.2.4

Vincent Lefevre vincent at
Mon Mar 23 10:53:00 CET 2009

On 2009-03-23 09:51:31 +0100, Torbjorn Granlund wrote:
> "Martin Ettl" <ettl.martin at> 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> - Web: <>
100% accessible validated (X)HTML - Blog: <>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

More information about the gmp-bugs mailing list