[uClibc] printf behaviour

Manuel Novoa III mjn3 at codepoet.org
Fri Aug 29 01:53:17 UTC 2003


John,

On Fri, Aug 29, 2003 at 11:19:37AM +1000, John Williams wrote:
> here's the output - seems to confirm that varg handling is broken, would 
> you agree?
> 
> main split 1234abcd 8765fedc 
> 
> msg="fmt string arg" 
> 
> varg split 0000001d 1234abcd 

Hmm... It is definitely looking like a compiler issue.  But you had
mentioned that you were suspicious of casts as well.  You might also
want to try the code below as an additional check.

Manuel


#define _ISOC99_SOURCE
#include <stdio.h>

static void show_longlong(void *p)
{
	long long x = *((long long *)p);

	printf("vptr split %08x %08x\n", (unsigned)((x >> 32) & 0xFFFFFFFF),
		   (unsigned)(x & 0xFFFFFFFF));
};

int main(void)
{
	long long x = 0x1234abcd8765fedcLL;

	printf("main split %08x %08x\n", (unsigned)((x >> 32) & 0xFFFFFFFF),
		   (unsigned)(x & 0xFFFFFFFF));

	show_longlong((void *)(&x));

	return 0;
}



More information about the uClibc mailing list