delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Message-ID: | <000501c308f4$2c001070$c2020c0a@jbaker1200> |
From: | "Jeff Baker" <jbaker AT qnx DOT com> |
To: | "Max Bowsher" <maxb AT ukf DOT net>, <cygwin AT cygwin DOT com> |
References: | <003d01c308ed$07e6e670$78d96f83 AT pomello> |
Subject: | Re: CompactFlash Disk Geometry |
Date: | Tue, 22 Apr 2003 13:25:29 -0400 |
MIME-Version: | 1.0 |
X-Priority: | 3 |
X-MSMail-Priority: | Normal |
X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.3718.0 |
I wouldn't expect to see it print a full 64 bit integer, but I was wondering why it's pushing the rest of the data out of place. VC: 15680 1 1 512 Cygwin: 15680 0 1 1 If it was merely a problem with printing the 64 bit argument then shouldn't that be the only one that's mangled in the output? In this data '15680' is coming from the LARGE_INTEGER but I don't know where the zero is coming from, or why the last element goes from 512 to 1, or where the 512 vanishes to. > Jeff Baker wrote: > > Ok so allow me to correct myself here. The 'Cylinders' element in the > > DISK_GEOMETRY structure is a LARGE_INTEGER, which isn't being printed > by a > > simple printf("%d"). If I print the Cylinders.LowPart element the > output > is > > correct. Since trying to printf a LARGE_INTEGER works on both Visual > C > and > > a version of Watcom I have, is this a bug in Cygwin? > > Why would you expect %d to print a LARGE_INTEGER? I suspect that your > Visual > C and Watcom programs will give incorrect output for values larger than > 2^31. > > Printing 64-bit ints is rather nonstandard, unfortunately. > > For MSVCRT, I guess (untested) you would need %I64d. > For newlib (Cygwin), you will need %lld or %qd. > > > > Max. > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |