From owner-freebsd-bugs Fri Apr 30 19:10: 4 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 07253155A5 for ; Fri, 30 Apr 1999 19:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id TAA01473; Fri, 30 Apr 1999 19:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Fri, 30 Apr 1999 19:10:01 -0700 (PDT) Message-Id: <199905010210.TAA01473@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "Daniel C. Sobral" Subject: Re: kern/11411: code typo in clones.c: "if ((mpu_config = NULL))" should be "if ((mpu_config != NULL))" Reply-To: "Daniel C. Sobral" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/11411; it has been noted by GNATS. From: "Daniel C. Sobral" To: cpeterso@cs.washington.edu Cc: freebsd-gnats-submit@FreeBSD.ORG, Luigi Rizzo Subject: Re: kern/11411: code typo in clones.c: "if ((mpu_config = NULL))" should be "if ((mpu_config != NULL))" Date: Sat, 01 May 1999 10:57:47 +0900 cpeterso@cs.washington.edu wrote: > > >Description: > i386/isa/snd/clones.c (line 217): if (X=0) 3: > if((mpu_config=NULL)) > should be: > if ((mpu_config != NULL)) { Not exactly. Man style. That said... The double parenthesis on the above line do nothing except *HIDE* the error! That is, supposing it *is* an error (I cannot conceive it not being one)... This is just the kind of thing that should *not* be done (thoughless "fix" of warnings). Now, that said... It is all the better that it is written this way. If your changes were to be committed, it would introduce a bug. See, mpu_config is a local variable, and it is *not* static, and it has *not* been initialized. So, the above line initializes it, and, at the same time, executes the correct branch of the code. After your changes, we would risk values being initialized from structure elements of an unitialized pointer. -- Daniel C. Sobral (8-DCS) dcs@newsguy.com dcs@freebsd.org "Proof of Trotsky's farsightedness if that _none_ of his predictions have come true yet." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message