Subject: printf/scanf: %Lx format broken?
From: [email-masked] (Peter Craft)

5 Dec 1997 21:52:35 -0800
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: [email-masked]

Hi, 

It seems that the long long size modifier (L) is broken
in printf and scanf.  If I compile the following program:

#include <stdio.h>
#include <sys/types.h>

main(argc, argv)
	 int argc;
	 char **argv;
{
	long long 	foo;

	sscanf(argv[1], "%Lx", &foo);
	printf("foo %Lx\n", foo);
}

and run it on my NT system as follows I get:

==> ./foo 0x123456789
foo ffffffff

Whereas the same program on a Solaris system it gives me the proper:

==> ./a 0x123456789
foo 123456789

Am I missing something?  I have also tried %llx instead of %Lx
with the same results.

Thanks.

Pete
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".