This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CompactFlash Disk Geometry


Jeff Baker wrote:
> 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.

That zero is the HighPart of your LARGE_INTEGER.
It seems gcc uses a different ABI for varargs.

Trivial test program to confirm:

#include <stdio.h>
#include <windows.h>

int main(int argc, char* argv[])
{
  LARGE_INTEGER l;
  int i = 1;
  int j = 2;
  int k = 3;

  l.QuadPart = (5LL << 32) + 4;

  printf("%d %d %d %d\n", l, i, j, k);

  return 0;
}

Output:
4 5 1 2



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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]