gmp_gcdext method on 32bit vs 64 bit machines
arndt at jjj.de
Sat Apr 30 16:09:07 CEST 2011
* Emmanuel Thomé <Emmanuel.Thome at gmail.com> [Apr 30. 2011 09:41]:
> On Fri, Apr 29, 2011 at 04:54:18PM -0400, Waiki Wright wrote:
> > mpz_init_set_d(B,23434293864345);
> I was just about to say ``you sure know about compiler warnings, don't
> you ?''.
> truffe /tmp $ gcc-4.4 -m32 -W -Wall zozo.c -lgmp
> zozo.c: In function ‘main’:
> zozo.c:8: warning: integer constant is too large for ‘long’ type
> zozo.c:9: warning: integer constant is too large for ‘long’ type
> However it very much seems that gcc-4.5 now silently drops this warning
> (I tested 4.5.1 and 4.5.2, but with the 32-bit ABI of my 64-bit laptop).
> While your mistake is pretty obvious, I am slightly amazed to see that
> this potentially useful warning for a silly mistake is no longer emitted.
> You might want to file a bug for gcc (please search the BTS first to see
> if it hasn't been reported already).
> > [...]
I'd like to add: _always_ switch on optimization,
just to get more warnings:
gcc -O2 -W -Wall ...
(don't know if it helps here)
More information about the gmp-discuss