delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/01/15/19:47:04

From: shankar AT chromatic DOT com (Shankar Unni)
Subject: printf of long long broken?
15 Jan 1997 19:47:04 -0800 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <32DD94CE.1B938BCB.cygnus.gnu-win32@chromatic.com>
Mime-Version: 1.0
X-Mailer: Mozilla 3.01Gold (X11; I; Linux 2.0.18 i586)
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

I tried to compile and run the following program using Beta 17.1:

 #include <stdio.h>
 main()
 {
    long long ll = 0x0123456789abcdefLL;
    printf("%llx %x\n", ll, 0x100);
 }

This program prints out:

 89abcdef 1234567

Looks like printf is simply treating "%llx" as "%lx", and gets totally
out of sync.

This program works on non-windows Intel boxes, so I'm sure the program
is correct. I assume the library that's in cygwin.dll is "newlib": did
it get built somehow with _NO_LONGLONG?


By the way, in a related vein, I notice that %llx doesn't work in
Microsoft C++ either (they insist on "%I64x"), so we're kinda screwed
here..
-- 
Shankar Unni                                  shankar AT chromatic DOT com
Chromatic Research                            (408) 752-9488
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019