From owner-freebsd-current Fri Dec 13 5:41:13 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0A5437B401; Fri, 13 Dec 2002 05:41:11 -0800 (PST) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id C882443E4A; Fri, 13 Dec 2002 05:41:10 -0800 (PST) (envelope-from ache@pobrecita.freebsd.ru) Received: from pobrecita.freebsd.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.12.6/8.12.6) with ESMTP id gBDDf7HE032906; Fri, 13 Dec 2002 16:41:07 +0300 (MSK) (envelope-from ache@pobrecita.freebsd.ru) Received: (from ache@localhost) by pobrecita.freebsd.ru (8.12.6/8.12.6/Submit) id gBDDf6sP032905; Fri, 13 Dec 2002 16:41:06 +0300 (MSK) (envelope-from ache) Date: Fri, 13 Dec 2002 16:41:06 +0300 From: "Andrey A. Chernov" To: Ruslan Ermilov 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> References: <20021213122654.GA32014@nagual.pp.ru> <20021213123240.GC86638@sunbay.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <20021213123240.GC86638@sunbay.com> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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? >=20 > #include > void > main(void) > { > int i; >=20 > i =3D (unsigned char)1 - (unsigned char)2; > printf("%d\n", i); > } It very depends on compiler, i.e. does it implements "value preseving" or= =20 "unsigned preserving" for 'char' type conversions. Or ANSI C vs. common C= =20 mode. Better be safe for both. Read 6.10.1.1 section here: http://wwwrsphysse.anu.edu.au/doc/DUhelp/AQTLTBTE/DOCU_067.HTM --=20 Andrey A. Chernov http://ache.pp.ru/ --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iQCVAwUBPfnjcuJgpPLZnQjrAQEc6wQAp+LJQJ7DRaMRGdhg5GrpPUQg3IJf2nO2 LYV+/H4pPRkMcmTXPu7DjNaXvEDYkKYmlzyXkzVvYYTeItqDoxVmDRncpFAY7xwm S291En345DnHlKVIOl7Ek3UQQxhGFsqFVyI/U2/cppCKU6WgmWnAPTvY6BUYhNGZ CzVq6Dn0dAM= =/J58 -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message