From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 26559 invoked from network); 14 Nov 1998 07:19:01 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 14 Nov 1998 07:19:01 -0000 Received: from io.nu (qmailr@dogbert.advancenet.net [209.44.30.54]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id CAA24265 for ; Sat, 14 Nov 1998 02:19:00 -0500 From: sterwill@io.nu Received: (qmail 23175 invoked by uid 1000); 14 Nov 1998 13:20:51 -0000 Message-ID: <19981114132051.23174.qmail@io.nu> Subject: Re: Any C++ on Alpha gfurus out there? To: axp-list@redhat.com Date: Sat, 14 Nov 1998 13:20:51 +0000 (GMT) In-Reply-To: from "Bob McElrath" at Nov 13, 98 07:06:02 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > 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)