From: Anders Hammarquist <iko@cd.chalmers.se>
To: axp-list@redhat.com
Subject: Re: Any C++ on Alpha gfurus out there?
Date: Fri, 13 Nov 1998 20:26:26 +0100 [thread overview]
Message-ID: <199811131926.UAA21759@zlotzky.cd.chalmers.se> (raw)
In-Reply-To: Message from "Nicholas Sallembian" <nsallembian@inprise.com> of "Fri, 13 Nov 1998 11:17:14 PST." <364C85B9.5DC8AD59@inprise.com>
> Try this code :
>
> const char * EV_UnixMenu::_getItemPath(AP_Menu_Id id) const
> {
> for (UT_uint32 k=0; (k < m_nrActualFactoryItems); k++)
> {
> _wd * wd = (_wd *)m_menuFactoryItems[k].callback_action;
> if (wd)
> if (wd->m_id==id)
> return m_menuFactoryItems[k].path;
> }
>
> There might be a problem in the order the if expression is evaluated : if wd is
> NULL and wd->m_id is evaluated first... Crash !
If this code works and the other doesn't you've found a compiler bug. && is
supposed to evaluate left to right (lazily, so that it stops when it knows the
outcome).
/Anders
--
-- Of course I'm crazy, but that doesn't mean I'm wrong.
Anders Hammarquist | iko@cd.chalmers.se
Not system administrator at DjungelData | Hem: +46 31 47 69 27
Chalmers University of Technology, G|teborg, Sweden | Mob: +46 707 27 86 87
next prev parent reply other threads:[~1998-11-13 19:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-11-13 19:10 Any C++ on Alpha gfurus out there? Brian E.W. Wood
1998-11-13 19:17 ` Nicholas Sallembian
1998-11-13 19:25 ` B. James Phillippe
1998-11-13 21:48 ` Nicholas Sallembian
1998-11-14 1:06 ` Bob McElrath
1998-11-14 13:20 ` sterwill
1998-11-14 17:37 ` Brian E.W. Wood
1998-11-13 19:26 ` Anders Hammarquist [this message]
1998-11-13 19:37 ` Heinz Ulrich Stille
1998-11-16 3:50 ` Michael J. Donahue
1998-11-16 13:15 ` Stefan Schroepfer
1998-11-16 13:45 ` Paul Tomblin
1998-11-16 14:24 ` Stefan Schroepfer
1998-11-16 14:43 ` Leo
-- strict thread matches above, loose matches on Subject: below --
1998-11-16 14:49 Leo
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox