From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 5950 invoked from network); 14 Nov 1998 01:06:17 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 14 Nov 1998 01:06:17 -0000 Received: from draal.physics.wisc.edu (mcelrath@draal.physics.wisc.edu [128.104.223.134]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id UAA16747 for ; Fri, 13 Nov 1998 20:06:17 -0500 Received: from localhost (mcelrath@localhost) by draal.physics.wisc.edu (8.8.7/8.8.7) with ESMTP id TAA09529 for ; Fri, 13 Nov 1998 19:06:02 -0600 Date: Fri, 13 Nov 1998 19:06:02 -0600 (EST) From: Bob McElrath To: axp-list@redhat.com Subject: Re: Any C++ on Alpha gfurus out there? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 13 Nov 1998, B. James Phillippe wrote: > On Fri, 13 Nov 1998, Nicholas Sallembian wrote: > > > Try this code : > ... > > if (wd) > > if (wd->m_id==id) > ... > > 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 ! > > [over the original code] : > > > > if (wd && (wd->m_id==id)) > > I sincerely hope that is not the problem; it is very clearly defined in the > C programming language that logical AND and OR operations proceed from left > to right. It is, of course possible that the pointer wd has a non-zero value, but points to memory not owned by the process...that would still cause a seg fault, and would have been evaluated properly... -- Bob ./'^`\._./'~`\._./'~`\._./'~`\._./'#`\._./'~`\._./'~`\._./'~`\._./'^`\. / Rube Goldberg? Bah! Amateur! I give you..Windows 98! Linux everywhere \ | Linux, because everyone's work is mission critical. ANYTHING inside. | |_Bob McElrath (mcelrath@wisconsin.cern.ch) Univ. of Wisconsin at Madison_| \.___________________________________________________________________./