|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: Potential Crash?
Left to right evaluation is guaranteed by the ANSI standard for C. If it doesn't work on the compiler you are using demad you money back. Bob P. Frag_ Daddy wrote: > > You could of course try it... or just write it > > if(t) > if(t->number) > Do something. > > But I'll speculate anyway. I'm thinking that the first way would work > on most, if not all compilers, but you should know that I base this on > nothing... > > >From: Jörg Rüppel <rueppel@trinode.com> > >Reply-To: gameprogrammer@gameprogrammer.com > >To: <gameprogrammer@gameprogrammer.com> > >Subject: Potential Crash? > >Date: Fri, 6 Oct 2000 16:48:11 +0200 > > > >Hi, > > > >I just want to know if this code is valid: > > > >TILE *t = blah..; > > > >if ((t) && (t->number)) blahhh... > > > >Could this crash on some compilers if 't' is NULL? Or do ALL compilers > >evaluate this from left to right and stop if one of the clauses are false? > > > >Thanks > >Jörg Rüppel > > > >================================================================= > >The GameProgrammer.Com mailing list is for the open discussion > >of any topic related to the art, science, and business of > >programming games. This list is especially tolerant of beginners. > >We were all beginners once > > > >To SUBSCRIBE or UNSUBSCRIBE please visit: > >http://gameprogrammer.com/mailinglist.html > > > > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > > Share information about yourself, create your own public profile at > http://profiles.msn.com. > > ================================================================= > The GameProgrammer.Com mailing list is for the open discussion > of any topic related to the art, science, and business of > programming games. This list is especially tolerant of beginners. > We were all beginners once > > To SUBSCRIBE or UNSUBSCRIBE please visit: > http://gameprogrammer.com/mailinglist.html ================================================================= The GameProgrammer.Com mailing list is for the open discussion of any topic related to the art, science, and business of programming games. This list is especially tolerant of beginners. We were all beginners once To SUBSCRIBE or UNSUBSCRIBE please visit: http://gameprogrammer.com/mailinglist.html
|
|