Path: utzoo!attcan!uunet!know!sdd.hp.com!elroy.jpl.nasa.gov!zardoz.cpd.com!dhw68k!felix!arcturus!evil From: evil@arcturus.uucp (Wade Guthrie) Newsgroups: comp.os.msdos.programmer Subject: TC++ pointers (compiler bug?) Message-ID: <1990Oct16.212118.6736@arcturus.uucp> Date: 16 Oct 90 21:21:18 GMT Organization: Rockwell International Lines: 39 I have been trying to port some stuff that I did at someone else's computer (and had working) to my home machine w/Turbo C++. After hours of debugging, I found a gotcha. The bit of code looked something like: typedef struct MENU {...} MENU; main() { MENU *variable; ... function(variable); ... } void function(MENU *variable) { printf("variable is at %p\n",variable); ... } The problem is that I use the turbo debugger to print the value of variable and it doesn't match the printed value by printf. Now, this works fine with other variables. I really wouldn't care, but dereferencing "variable" results in a spontaneous reboot. I found the same problem with a different program and recompiling helped. Not in this case though. Could this be a memory model problem (I believe that I'm using the large model everywhere), or is there a known bug going about? Thanks. -- Wade Guthrie (evil@arcturus.UUCP) | "He gasped in terror at what sounded Rockwell International; Anaheim, CA | like a man trying to gargle while My opinions, not my employer's. | fighting off a pack of wolves" | Hitchhiker's Guide