From owner-freebsd-bugs Mon May 27 05:47:17 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id FAA10370 for bugs-outgoing; Mon, 27 May 1996 05:47:17 -0700 (PDT) Received: from onyx.nervosa.com (root@nervosa.com [192.187.228.86]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id FAA10361; Mon, 27 May 1996 05:47:14 -0700 (PDT) Received: (from coredump@localhost) by onyx.nervosa.com (8.7.5/8.7.3) id FAA10887; Mon, 27 May 1996 05:45:51 -0700 (PDT) Date: Mon, 27 May 1996 05:45:50 -0700 (PDT) From: "Chris J. Layne" To: Bruce Evans cc: freebsd-bugs@freefall.freebsd.org, jkh@freefall.freebsd.org, scrappy@freefall.freebsd.org Subject: Re: gnu/373 In-Reply-To: <199605270814.SAA28182@godzilla.zeta.org.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Mon, 27 May 1996, Bruce Evans wrote: > Close it and "hope" it was never mentioned. There is no bug. The pointer > dereference is valid. The error message is the same as for > > struct { int i; } foo; void bar(void) { if (foo) baz(); } > > The test would be better written as `if (foo != NULL)'. Then it is obvious > that there is a binary operator `!='. Structs are invalid operands for > '!='. > Bruce Than wouldn't that be illegal? Why not: struct { int i; } foo; void bar(void) { if (foo.i) baz(); } or struct type_1 { int i; } *foo; foo = (struct type_1 *)malloc(sizeof(struct type_1)); void bar(void) { if (foo) baz(); } == Chris Layne ======================================== Nervosa Computing == == coredump@nervosa.com ================ http://www.nervosa.com/~coredump ==