[Issue 905] New: printf strangeness
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Mon Jan 29 16:25:59 PST 2007
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=905
           Summary: printf strangeness
           Product: D
           Version: 1.002
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: someanon at yahoo.com
$ cat pp.d
int main(char[][] args) {
  int i;
  ulong addr;
  for (i = 0; i < 10; i++) {
    addr = cast(ulong)(&i) + i;
    addr = ((addr + 3) >> 2) << 2;
    printf("%d %d %d \n", i, addr, i);
  }
  return 0;
}
$ dmd.exe pp.d
g:\project\dmd\bin\..\..\dm\bin\link.exe pp,,,user32+kernel32/noi;
$ ./pp.exe
0 1244976 0
1 1244980 0
2 1244980 0
3 1244980 0
4 1244980 0
5 1244984 0
6 1244984 0
7 1244984 0
8 1244984 0
9 1244988 0
(Note the 3rd column, all 0!)
-- 
    
    
More information about the Digitalmars-d-bugs
mailing list