Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262566AbUCJKek (ORCPT ); Wed, 10 Mar 2004 05:34:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262568AbUCJKek (ORCPT ); Wed, 10 Mar 2004 05:34:40 -0500 Received: from gate.firmix.at ([80.109.18.208]:36495 "EHLO gate.firmix.at") by vger.kernel.org with ESMTP id S262566AbUCJKei (ORCPT ); Wed, 10 Mar 2004 05:34:38 -0500 Subject: Re: (0 == foo), rather than (foo == 0) From: Bernd Petrovitsch To: "Godbole, Amarendra (GE Consumer & Industrial)" Cc: linux-kernel@vger.kernel.org In-Reply-To: <905989466451C34E87066C5C13DDF034593392@HYDMLVEM01.e2k.ad.ge.com> References: <905989466451C34E87066C5C13DDF034593392@HYDMLVEM01.e2k.ad.ge.com> Content-Type: text/plain Organization: Firmix Software GmbH Message-Id: <1078914873.23072.3.camel@tara.firmix.at> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 10 Mar 2004 11:34:33 +0100 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1015 Lines: 24 Reformatted long lines - please fix your mailer. On Mit, 2004-03-10 at 07:16, Godbole, Amarendra (GE Consumer & Industrial) wrote: > While writing code, the assignment operator (=) is many-a-times confused > with the comparison operator (==) resulting in very subtle bugs difficult > to track. To keep a check on this -- the constant can be written on the > LHS rather than the RHS which will result in a compile time error if wrong > operator is used. Or you use `gcc -Wall` which also reports this (and also in the cases where both sides of the comparison can be left hand sides). Bernd -- Firmix Software GmbH http://www.firmix.at/ mobil: +43 664 4416156 fax: +43 1 7890849-55 Embedded Linux Development and Services - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/