Article View: comp.os.msdos.programmer
Article #2732TC++ pointers (compiler bug?)
From: Wade Guthrie
Date: Tue, 16 Oct 1990 21:21
Date: Tue, 16 Oct 1990 21:21
38 lines
1588 bytes
1588 bytes
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
Technical Details
Message-ID:
<1990Oct16.212118.6736@arcturus.uucp>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!sdd.hp.com!elroy.jpl.nasa.gov!zardoz.cpd.com!dhw68k!felix!arcturus!evilShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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