|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: Potential Crash?
> 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? AFAIK, the ANSI C standard says that you CAN do this safely, with guaranteed left-to-right evaluation. I know I use it all the time. -[ Neil-Edelman -- dreaded.neil@phreaker.net -- ICQ UIN: 705130 -[ http://neil.freeshell.org/ -- http://moop.bizland.com/ -[ "My air-to-air missile overrides your air traffic control clearance" ================================================================= 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
|
|