Date: Fri, 13 Dec 2002 16:41:06 +0300 From: "Andrey A. Chernov" <ache@nagual.pp.ru> To: Ruslan Ermilov <ru@FreeBSD.ORG> Cc: bwk@bell-labs.com, obrien@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: New AWK bug with collating Message-ID: <20021213134106.GA32832@nagual.pp.ru> In-Reply-To: <20021213123240.GC86638@sunbay.com> References: <20021213122654.GA32014@nagual.pp.ru> <20021213123240.GC86638@sunbay.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Fri, Dec 13, 2002 at 14:32:40 +0200, Ruslan Ermilov wrote:
> Pardon my ignorance here, but the following fragment
> returns -1, doesn't it?
>
> #include <stdio.h>
> void
> main(void)
> {
> int i;
>
> i = (unsigned char)1 - (unsigned char)2;
> printf("%d\n", i);
> }
It very depends on compiler, i.e. does it implements "value preseving" or
"unsigned preserving" for 'char' type conversions. Or ANSI C vs. common C
mode. Better be safe for both.
Read 6.10.1.1 section here:
http://wwwrsphysse.anu.edu.au/doc/DUhelp/AQTLTBTE/DOCU_067.HTM
--
Andrey A. Chernov
http://ache.pp.ru/
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (FreeBSD)
iQCVAwUBPfnjcuJgpPLZnQjrAQEc6wQAp+LJQJ7DRaMRGdhg5GrpPUQg3IJf2nO2
LYV+/H4pPRkMcmTXPu7DjNaXvEDYkKYmlzyXkzVvYYTeItqDoxVmDRncpFAY7xwm
S291En345DnHlKVIOl7Ek3UQQxhGFsqFVyI/U2/cppCKU6WgmWnAPTvY6BUYhNGZ
CzVq6Dn0dAM=
=/J58
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021213134106.GA32832>
