svn commit: r273734 - head/bin/dd

Dag-Erling Smørgrav des at des.no
Tue Oct 28 09:52:40 UTC 2014


Bruce Evans <brde at optusnet.com.au> writes:
> Dag-Erling Smørgrav <des at 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.

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.

§7.19.6.1

 9 If a conversion specification is invalid, the behavior is
   undefined. 239) If any argument is not the correct type for the
   corresponding conversion specification, the behavior is undefined.

The term "correct type" is not defined anywhere, and is only used in the
descriptions of fprintf() and fwprintf().

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the svn-src-head mailing list