From: Bob McElrath <mcelrath@draal.physics.wisc.edu>
To: axp-list@redhat.com
Subject: Re: Any C++ on Alpha gfurus out there?
Date: Fri, 13 Nov 1998 19:06:02 -0600 (EST) [thread overview]
Message-ID: <Pine.LNX.4.04.9811131905040.7312-100000@draal.physics.wisc.edu> (raw)
In-Reply-To: <Pine.LNX.4.04.9811131122320.1080-100000@earth.terran.org>
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_|
\.___________________________________________________________________./
next prev parent reply other threads:[~1998-11-14 1:06 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 [this message]
1998-11-14 13:20 ` sterwill
1998-11-14 17:37 ` Brian E.W. Wood
1998-11-13 19:26 ` Anders Hammarquist
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