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: 36 Message-ID: Date: Sat, 19 Nov 2005 04:50:48 GMT NNTP-Posting-Host: 165.247.25.142 X-Complaints-To: abuse AT earthlink DOT net X-Trace: newsread3.news.atl.earthlink.net 1132375848 165.247.25.142 (Fri, 18 Nov 2005 20:50:48 PST) NNTP-Posting-Date: Fri, 18 Nov 2005 20:50:48 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: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.