From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 10959 invoked from network); 13 Nov 1998 19:26:38 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 13 Nov 1998 19:26:38 -0000 Received: from haddock.cd.chalmers.se (root@haddock.cd.chalmers.se [129.16.79.2]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id OAA04904 for ; Fri, 13 Nov 1998 14:26:37 -0500 Received: from zlotzky.cd.chalmers.se (root@zlotzky.cd.chalmers.se [129.16.79.61]) by haddock.cd.chalmers.se (8.8.7/8.8.7) with ESMTP id UAA29219 for ; Fri, 13 Nov 1998 20:26:32 +0100 (MET) Received: from zlotzky.cd.chalmers.se (iko@localhost [127.0.0.1]) by zlotzky.cd.chalmers.se (8.8.7/8.8.7) with ESMTP id UAA21759 for ; Fri, 13 Nov 1998 20:26:28 +0100 (MET) Message-Id: <199811131926.UAA21759@zlotzky.cd.chalmers.se> X-Mailer: exmh version 2.0.2 2/24/98 To: axp-list@redhat.com Subject: Re: Any C++ on Alpha gfurus out there? In-Reply-To: Message from "Nicholas Sallembian" of "Fri, 13 Nov 1998 11:17:14 PST." <364C85B9.5DC8AD59@inprise.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 13 Nov 1998 20:26:26 +0100 From: Anders Hammarquist > 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