Strange gcc warning.

Vincent Lefevre vincent at vinc17.org
Wed Apr 23 10:47:06 CEST 2008


On 2008-04-23 08:58:41 +0200, ezzetabi wrote:
> Here a minimalistic example:
> /* min.c */
> #include <gmp.h> 
> void f(const mpz_t* t) {
>     t = t;
> }
> int main() {
>     mpz_t e[5];
> 
>     f(e);
>     return 0;
> }
> $ gcc -W -Wall -pedantic min.c -lgmp
> min.c: In function ‘main’:
> min.c:9: warning: passing argument 1 of ‘f’ from incompatible pointer type

The warning is due to the "const".

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


More information about the gmp-discuss mailing list