www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000354

When Created: 08/03/2002 16:31:03
Against DJGPP version: 2.03
By whom: ams@ludd.luth.se
Abstract: printf()'s %#08x handling of 0 wrong
----- c.c starts. -----
#include <stdio.h>

int main(void)
{

  printf("%#08x %#08x\n", 1, 0);

  return 0;
}
----- c.c ends. -----
> ls -al /djgpp/lib/libc.a
-rw-r--r--    1 dosuser  root       637286 Dec 24  2001 /djgpp/lib/libc.a
> gcc -O2 -Wall -o c c.c -v
cd e:/hackery/djgpp.bug1/
gcc -O2 -Wall -o c c.c -v
Reading specs from e:/djgpp/lib/gcc-lib/djgpp/2.953/specs
gcc version 2.95.3 20010315/djgpp (release)
 e:/djgpp/lib/gcc-lib/djgpp/2.953/cpp0.exe -lang-c -v -D__GNUC__=2 -D__GNUC_MINO
R__=95 -Dunix -Di386 -DGO32 -DDJGPP=2 -DMSDOS -D__unix__ -D__i386__ -D__GO32__ -
D__DJGPP__=2 -D__MSDOS__ -D__unix -D__i386 -D__GO32 -D__DJGPP=2 -D__MSDOS -Asyst
em(unix) -Asystem(msdos) -Acpu(i386) -Amachine(i386) -D__OPTIMIZE__ -Wall -Acpu(
i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -D__tune_pentium__ -imacros e:/
djgpp/lib/djgpp.ver -remap c.c t:\tmp\ccs8E8Ke.i
GNU CPP version 2.95.3 20010315/djgpp (release) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 e:/djgpp/lib/gcc-lib/djgpp/2.953/include
 e:/djgpp/include
End of search list.
The following default directories have been omitted from the search path:
 $DJDIR/lang/cxx
 $DJDIR/lib/gcc-lib/djgpp/2.953/../../../../djgpp/include
End of omitted list.
 e:/djgpp/lib/gcc-lib/djgpp/2.953/cc1.exe t:\tmp\ccs8E8Ke.i -quiet -dumpbase c.c
 -O2 -Wall -version -o t:\tmp\ccK696lj.s
GNU C version 2.95.3 20010315/djgpp (release) (djgpp) compiled by GNU C version 
2.95.3 20010315/djgpp (release).
 e:/djgpp/bin/as.exe -o t:\tmp\ccs2M7Fq.o t:\tmp\ccK696lj.s
 e:/djgpp/lib/gcc-lib/djgpp/2.953/collect2.exe -o c e:/djgpp/lib/crt0.o -Le:/djg
pp/lib -Le:/djgpp/lib/gcc-lib/djgpp/2.953 -Le:/djgpp/bin -Le:/djgpp/lib t:\tmp\c
cs2M7Fq.o -lgcc -lc -lgcc -Tdjgpp.djl
 e:/djgpp/bin/stubify.exe -v c
stubify for djgpp V2.X executables, Copyright (C) 1995 DJ Delorie
stubify: c -> c.000 -> c.exe
> ./c
0x000001 00000000

Expected result:
0x000001 0x000000

Note how the "x" is a zero.


Right,

						MartinS

Solution added: 09/14/2002 06:02:08
By whom: ams@ludd.luth.se
Printing all zeroes without any "x" is correct according to the C standard.


Right,

						MartinS

Fixed in version on 09/14/2002 06:03:51
By whom: ams@ludd.luth.se



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010