Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262253AbUKVS6S (ORCPT ); Mon, 22 Nov 2004 13:58:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262263AbUKVS4k (ORCPT ); Mon, 22 Nov 2004 13:56:40 -0500 Received: from fw.osdl.org ([65.172.181.6]:55995 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S262266AbUKVSyW (ORCPT ); Mon, 22 Nov 2004 13:54:22 -0500 Date: Mon, 22 Nov 2004 10:54:17 -0800 (PST) From: Linus Torvalds To: Mitchell Blank Jr cc: Jan Engelhardt , Linux Kernel List Subject: Re: sparse segfaults In-Reply-To: <20041122183956.GA50325@gaz.sfgoth.com> Message-ID: References: <20041120143755.E13550@flint.arm.linux.org.uk> <20041122183956.GA50325@gaz.sfgoth.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1524 Lines: 37 On Mon, 22 Nov 2004, Mitchell Blank Jr wrote: > > When I want to do that I just use: > > #define MAX_SOMETHING (max_of_something + 0) Yes, I think I've done that too, and that works. My point is that the silly comma-expression should _also_ work, and I don't see any _valid_ use of the comma-expression as an lvalue. I suspect (but don't have any real argument to back that up) is that the gcc "extended lvalues" fell out as a side effect from how gcc ended up doing some random semantic tree parsing, and it wasn't really "designed" per se, as much as just a random implementation detail. Then somebody noticed it, and said "cool" and documented it. That's actually in my opinion a really good way to occasionally find a more generic form of something - the act of noticing that an algorithm just happens to give unintentional side effects that can actually be mis-used. So I don't think that it's a bad way per se to add features, especially as they then are often free (or even "negative cost", since _not_ adding the feature would entail having to add a check against it). And for all I know, many of the _good_ gcc features ended up being done that way too. But I think the (unintentional) downsides of these features are bigger than the advantages. Linus - 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/