X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Martin Ambuhl User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: printf() doesn't print long long intege, maybe RHIDE problem References: <437d9a13 AT news DOT bezeqint DOT net> <9krff.1763$wf DOT 538 AT newsread3 DOT news DOT atl DOT earthlink DOT net> <437e55e2 DOT 279951667 AT localhost> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 67 Message-ID: Date: Sat, 19 Nov 2005 17:08:23 GMT NNTP-Posting-Host: 165.247.46.242 X-Complaints-To: abuse AT earthlink DOT net X-Trace: newsread1.news.atl.earthlink.net 1132420103 165.247.46.242 (Sat, 19 Nov 2005 09:08:23 PST) NNTP-Posting-Date: Sat, 19 Nov 2005 09:08:23 PST Organization: EarthLink Inc. -- http://www.EarthLink.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Rod Pemberton wrote: > "Martin Ambuhl" wrote in message > news:Iayff.1893$wf DOT 1283 AT newsread3 DOT news DOT atl DOT earthlink DOT net... > >>Rod Pemberton wrote: >> >>>"Martin Ambuhl" wrote in message >>>news:Cxvff.2173$N45 DOT 189 AT newsread1 DOT news DOT atl DOT earthlink DOT net... >>> >>> >>>>Scott wrote: >>>> >>>> >>>>>On Fri, 18 Nov 2005 21:03:01 GMT, Martin Ambuhl >>>>>wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>>printf() do not print long long integer. >>>>>> >>>>>>Show us how it fails. Here is an example of it working: >>>>> >>>>> >>>>> >>>>>Here's another example: >>>>> >>>>>printf("%llX\n", (long long)-1); >>>> >>>>If you mean an example of undefined behavior. The %llX specifier >>>>expects an unsigned long long; (long long)-1 is not unsigned. >>> >>> >>>It's probably better to use capital L, instead of ll, since it works > > with > >>>multiple compilers... >>>e.g., >>> >>>sscanf(s,"%Lx",&value); >>> >>>printf("%Lu:%Lx\n",prime,counter); >>> >> >>Wrong. Since the L length modifier specifies that the argument is a >>long double, you've found another way to screw things up. > > > No sir, I am correct. You are partially correct. Come off it. You claimed that > It's probably better to use capital L, instead of ll, since it works > with multiple compilers... This is a gross error. Read what you have quoted from the standard: > an optional L specifying that a following e , E , f , g , or G conversion > specifier applies to a long double argument. If an h , l , or L appears with > any other conversion specifier, the behavior is undefined. Suggesting replacing a correct standard specifier with one with undefined behavior which is specific to particular implementations is a very peculiar way to targer "multiple compilers." You do a real disservice by doing such and should stop it. Your attempt to justify this anti-social suggestion contains the very language which shows you to be wrong.