Article View: comp.sys.ibm.pc.programmer
Article #1026Re: This can't be a TurboC bug can it?
From: Tom Wiencko
Date: Wed, 01 Aug 1990 12:18
Date: Wed, 01 Aug 1990 12:18
36 lines
1450 bytes
1450 bytes
CRN@BYUVM.BITNET writes:
>I am having a VERY weird problem in TurboC. My code looks
>something like this:
>typedef struct{
> . . .
> char *str;
>int type;
>}FIELD;
>int proc(FIELD *fld)
>{
> . . .
> if(!valid_str(fld->str))
> return ERROR;
> . . .
>}
Turn off register optimization. There must be some code around the
function call which also uses the pointer - and with register optimization
turned on the compiler sometimes "forgets" which registers he has used
and which still have valid pointers in them.
Took me two days of intense debugging to find this, and it was confirmed
by Borland tech support. They also said that there is at this time no
fix for the problem.
I am not sure if Turbo C++ has the same bug - I have not tested it yet
(but I have left the optimization off...).
Tom
--
Tom Wiencko (w) (404) 977-4515
gatech!stiatl!tom Wiencko & Associates, Inc.
Technical Details
Message-ID:
<10363@stiatl.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!swrinde!emory!stiatl!tomReferences:
<1990Jul30.050221.29945@caen.engin.umich.edu> <90212.105510CRN@BYUVM.BITNET>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!swrinde!emory!stiatl!tom From: tom@stiatl.UUCP (Tom Wiencko) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: This can't be a TurboC bug can it? Message-ID: <10363@stiatl.UUCP> Date: 1 Aug 90 12:18:35 GMT References: <1990Jul30.050221.29945@caen.engin.umich.edu> <90212.105510CRN@BYUVM.BITNET> Organization: Wiencko & Associates, Inc. Lines: 36