Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1a 12/4/83; site rlgvax.UUCP Path: utzoo!linus!decvax!microsoft!uw-beaver!cornell!vax135!ariel!hou5f!hou5g!hou5h!eagle!harpo!seismo!rlgvax!guy From: guy@rlgvax.UUCP Newsgroups: net.bugs.4bsd Subject: Re: yet another 4.2 bug Message-ID: <1455@rlgvax.UUCP> Date: Wed, 14-Dec-83 00:00:47 EST Article-I.D.: rlgvax.1455 Posted: Wed Dec 14 00:00:47 1983 Date-Received: Fri, 9-Dec-83 06:29:53 EST References: <6620@arizona.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 17 While we're on the subject of %D, please note that System III and later versions of UNIX do *NOT* support %D as a synonym for %ld. More specifically, %X doesn't mean %lx, it means "%x only put the hex digits 'a' through 'f' out in upper case." (This would have been useful for someone who complained a few months ago that it was a pain to get "*printf" to produce output to make his PROM burner, which expected upper-case hex, happy.) Since "%ld" will work on any reasonable (i.e., V6 with V7 Phototypesetter or later) UNIX, but "%D" works on pre-S3 UNIXes, people should get in the habit of using "%ld" rather than "%D" (it will also keep SCCS happier). While you're all fixing your code, note that printing a long should *always* be done with "%ld", not "%d", even though you "know" you're running on a machine with 32-bit "int"s. The next person that compiles your program may not be running on such a machine... Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy