Two possibly relevant warnings in mpn/udiv_w_sdiv.c
Marian Kechlibar
marian.kechlibar at circletech.net
Sun Nov 27 18:38:39 CET 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
It is ARM compiler (RVCT) 2.2, and the warning is
#68-D: integer conversion resulted in a change of sign
which is what I would expect. The warning can be suppressed with an
explicit cast like this:
q = (mp_limb_t) -1;
I tried compiling the same code with GCC 4.4, it didn't give me any
warnings.
Best regards
Marian
Dne 26.11.2011 23:13, Niels Möller napsal(a):
> Marian Kechlibar <marian.kechlibar at circletech.net> writes:
>
>> I have recently tried to compile the file with warnings turned to a high
>> level, and the compiler alerted me to incorrect assignment. Namely,
>> the lines q = -1; and q = -2;, very close to the end
>> of the file, constitute assignment of a negative value to q, which may
>> be of unsigned type (unsigned long etc.)
>
> I think this should be properly sign-extended in case mp_limb_t is
> larger than an int (but I would have to read the C spec to say for
> sure).
>
> As always, it would be helpful if you could say which compiler (and
> flags) you were using, and quote the complete warning/error message.
>
> Regards,
> /Niels
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJO0nWfAAoJEOJiGpwt9DuCDk4QAIGZD22iw0uyukNwUesMcjEM
rKEZ5HvqY438gbUb3kkT0EX7BZp87bIxEeVk4AtChJkZvzXGUZySx7TwNjbvHVey
cWZk1vf6GQbsdeQ04eJ0quV3Lu1klb2P53zxc875tvkeCsZXdZ5mEXDxe8R87s9T
HE+SAXA4sE12Cu+VHCTFzgDEGrrkgZkZ/u0YPDG0lKzc6k0IW9CfNoeAS/cCFO+9
2puoYjv85sMzqcHiSyhec2/IWg4k2oL9Vz+CHmg7+lDfBRdQ9ILHIMw4qtZh6o6u
DsoS81ZDz6yOxLLFFJDsrdRp5Csdd38H+FNgDDIx9tGu1OMCo8eREm17Pal2xfkr
ZfIUxti/LblZKQp/Z3zMfoB2y9tDxOYX8n7tjaNEbwY6yyhy2u/FVmOn9MHQQ8R0
mNHwe7vQCFsyOuNTAQ6g/+GAkcBXdmCLN/QF+XPbi7e8BKLrXOHeg75sIrenUOgr
vwbQ5mWVtunXW/NH9hszCqu77owf+uKyyOgznEpcuc7Aaa9yChAgb+nK1a72Sbo1
K959RcER6k3ZdDaBZcO+WBdGpFwbKvOoOfKx++OOwNWZiFDIkGxoVHF35n2nTRqJ
yhmPqgxJhAakzhsDgRLUg9PpRie6ZG84wg58vrg6FPnLaa/1Gyd1JnWtaml38KoS
+5fj5k0qubMl0aps9e4H
=9J7H
-----END PGP SIGNATURE-----
More information about the gmp-devel
mailing list