Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Oct 2014 14:30:37 -0700
From:      Garrett Cooper <yaneurabeya@gmail.com>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Kurt Jaeger <pi@freebsd.org>, Konstantin Belousov <kostikbel@gmail.com>, =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no>
Subject:   Re: svn commit: r273734 - head/bin/dd
Message-ID:  <BACF8450-1ECB-4EBF-9EEB-C8D38F081BFC@gmail.com>
In-Reply-To: <20141028210830.L1034@besplex.bde.org>
References:  <201410271138.s9RBcHrA002447@svn.freebsd.org> <20141027153957.GZ1877@kib.kiev.ua> <20141027155427.GM1492@f10.opsec.eu> <86vbn4egjt.fsf@nine.des.no> <20141028200418.E849@besplex.bde.org> <86mw8ged20.fsf@nine.des.no> <20141028210830.L1034@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_537C600A-464D-4B99-B286-17F6C1C194DB
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252

On Oct 28, 2014, at 4:33, Bruce Evans <brde@optusnet.com.au> wrote:

> On Tue, 28 Oct 2014, [utf-8] Dag-Erling Sm=F8rgrav wrote:
>=20
>> Bruce Evans <brde@optusnet.com.au> writes:
>>> Dag-Erling Sm=F8rgrav <des@des.no> writes:
>>>> This is a bug on all platforms, and both clang and (recent) gcc
>>>> should complain about it.  That printf() call will print garbage.
>>> No, this is only a bug on 32-bit arches.  The is is SSIZE_MAX.
>>=20
>> If you mean "it only has consequences on 32-bit arches", then I agree =
-
>> but it is still a bug to pass an int to %jd.
>=20
> This is machine-dependent.  intmax_t may be int.  The only requirement
> on intmax_t is that it can represent any value of any signed integer
> type.  This is possible if the largest integer type is 64 bits (the
> smallest permitted largest type) and int is also 64 bits (and there
> are no complications for padding bits).  intmax_t can even be signed
> char if that is wide enough (not in POSIX starting 10-15 years ago,
> since signed char is now required to be 8 bits.  It is weird for
> intmax_t to have the lowest rank (not counting Bool), but FreeBSD uses
> this loophole to make it have second highest rank on 64-bit arches.

Indeed. For some giggles, look at this bug: =
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D191674 =
("printf("%tu", (intmax_t)-1) returns UINT64_MAX on i386, not =
UINT32_MAX=94).
Cheers,

--Apple-Mail=_537C600A-464D-4B99-B286-17F6C1C194DB
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQEcBAEBCgAGBQJUU/99AAoJEMZr5QU6S73eaPoIAJoklajBANchbv1dj1yHfslz
lOOA+QBzOHsVnc/6mncytOZeu2lUxN86n3EnEkRanyzs0csxMZI2DI+BXdBf3SnT
85WyoiBLMgv+7rqdkUc7xWzmRNQl7uV1CK464sFdpv1rYAaVT1gSCkZmXvKQALgg
qPiyBUz4M03P8yNT2tiJPPvK1NYw5e8NYatTaR81Qp9NgTUHvSO0s38oQMHziQ2g
MhuWhWWOySzF6NhW/dcBOzB5Hzp8Rbwnio8WIcuwy/zlK5Jeozgb+zQulqEP96UK
Q+OJ1AMIJ7WNIy17Ts1kRMdVCdJu3lOrquJ8rdy96tppP0wDAeKYUYIRdtXrVZM=
=LbDi
-----END PGP SIGNATURE-----

--Apple-Mail=_537C600A-464D-4B99-B286-17F6C1C194DB--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BACF8450-1ECB-4EBF-9EEB-C8D38F081BFC>