Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rochester!rutgers!clyde!bellcore!faline!ulysses!allegra!alice!ark From: ark@alice.UUCP Newsgroups: comp.lang.c Subject: Re: printf's %D, %O, and %X Message-ID: <7131@alice.UUCP> Date: Mon, 27-Jul-87 00:35:53 EDT Article-I.D.: alice.7131 Posted: Mon Jul 27 00:35:53 1987 Date-Received: Fri, 31-Jul-87 01:44:28 EDT References: <1667@xanth.UUCP> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 19 In article <1667@xanth.UUCP>, kyle@xanth.UUCP writes: > For a long time now I've been under the impression that using "%D"," %O", and > "%X" in a printf() conversion spec is equivalent to using "%ld", "%lo", and > "%lx". However when I looked at the documentation for printf (4.3 BSD) I > discovered that capitalizing "%d, "%o", and "%x" are not mentioned at all. > > Do anyone know if printf() used to handle "%D", etc. as outlined above? Once upon a time, printf used to use %D, %O, %X to mean the same thing as %ld, %lo, %lx, respectively. More recent printf implementations leave %D and %O undefined and use %X to print an integer in hex using uppercase ABCDEF. Similarly for %E, %F, and %G (that is, print 3E10 instead of 3e10). %ld prints a long in all implementations, and similarly for %lo, %lx, and %lu. This dichotomy is mostly my fault. Sorry about that. --Andrew Koenig