Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uunet!unhd.unh.edu!msel.unh.edu!rg From: rg@msel.unh.edu (Roger Gonzalez) Newsgroups: comp.lang.c Subject: bug? in turbo c++ Message-ID: <1991Mar6.173733.430@unhd.unh.edu> Date: 6 Mar 91 17:37:33 GMT References: <1991Mar6.171424.17409@nntp-server.caltech.edu> Sender: usenet@unhd.unh.edu (USENET News System) Organization: UNH Marine Systems Engineering Laboratory Lines: 22 Nntp-Posting-Host: msel.unh.edu the following program demonstrates this "bug": main() { int i; long j; for (i = 0; i < 1000; i++, j = i*2) printf("oh crud: %x %10d %x\r", i, j, i); } The third number printed is always zero. It corrects itself if the second formatting string is %10ld. Is this a new ansi-ism? Will this behavior change to what my Unix cc fingers expect if I set it to K&R? Is it a bug? I can see them arguing that it isn't a bug, but I find it an unpleasant nonbug at the very least. -Roger -- "The question of whether a computer can think is no more interesting than the question of whether a submarine can swim" - Edsgar W. Dijkstra rg@[msel|unhd].unh.edu | UNH Marine Systems Engineering Laboratory r_gonzalez@unhh.bitnet | Durham, NH 03824-3525