Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: sterwill@io.nu
To: axp-list@redhat.com
Subject: Re: Any C++ on Alpha gfurus out there?
Date: Sat, 14 Nov 1998 13:20:51 +0000 (GMT)	[thread overview]
Message-ID: <19981114132051.23174.qmail@io.nu> (raw)
In-Reply-To: <Pine.LNX.4.04.9811131905040.7312-100000@draal.physics.wisc.edu> from "Bob McElrath" at Nov 13, 98 07:06:02 pm

> On Fri, 13 Nov 1998, B. James Phillippe wrote:
> > [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...

Well, as part of the AbiWord team, I can assure you that we're doing many
such assignment tests in the code (not good news, huh? :).  In fact, the new 
toolbar framework is similar to the implementation of the menu layout framework.  
In short, this looks like a compiler issue on the Alpha, but without access to an
Alpha (which I may have shortly if I buy one) it's hard to tell.  It's
a very legal C++ test; I'm using EGCS 1.1b with -Wall and often -pedantic
to keep out "that which is not ANSI," but on an Intel, which is all we
have available now.  

You know, this may be completely off here, but I'm wondering if the "&&"
is somehow not correct in ANDing the result of (wd->m_id == id) on a
platform where the size of "wd" (pointer) is not the same size as 
"(wd->m_id == id)" (bool same as int which is != size of pointer?).  Wild
guess here.  :)  I would assume this possibility is very remote 
since the evaluation is essentially "if(wd){if(wd->m_id==id) {} }", but
I haven't looked at the compiler source; it may be optimizing something
funny.

-- 
Shaw Terwilliger (twig@advancenet.net | sterwill@abisource.com)


  reply	other threads:[~1998-11-14  7:19 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 [this message]
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