lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/07/2013 12:36, Philipp Janda wrote:

> That may not do what is expected, because it involves 
> implementation-defined behavior:
> 
> 3.2.1.2 Signed and unsigned integers [...]  When an integer is
> demoted to a signed integer with smaller size, or an unsigned
> integer is converted to its corresponding signed integer, if the
> value cannot be represented the result is implementation-defined.

If I remember right, you can work around this with a memcpy() from the
unsigned variable to the signed variable.

Finn

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJR2rPYAAoJEHp3pOlF38H/jbYH/RS4bQpI7tFGa9Az+FA/oQ2/
WTM8eT72QtXYORdntgJ1dXtwevtaPjn7lYnKNeu5stavlB2s6ODAYPX9FAltFjYx
AWfDLDHnrkwu/VLikB5Pv4OtvSx5Ecx2gzx0OUTuxKV21qzWtKRCOSVZrKKQM9Ma
4a3J3FEE/tXD64H409GY6fVnrc/1hdcAyVxTql4vyK5/9t/r55LAnggLClT05fLv
Zil3Wz+IQU6KYfD9iKHLXPkL7BWc7rmqC10HDrll7hqI95FlZVuNUnqNhp6f64zz
+9sdJtcYaauMbumbntPIYGk3CQnsBDbSRzgSE7vOWRhVPtnAAPotXe/yye5EJE8=
=Oec9
-----END PGP SIGNATURE-----