Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261700AbTIGXVt (ORCPT ); Sun, 7 Sep 2003 19:21:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261711AbTIGXVt (ORCPT ); Sun, 7 Sep 2003 19:21:49 -0400 Received: from fw.osdl.org ([65.172.181.6]:23519 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S261700AbTIGXVs (ORCPT ); Sun, 7 Sep 2003 19:21:48 -0400 Date: Sun, 7 Sep 2003 16:21:44 -0700 (PDT) From: Linus Torvalds To: Arnd Bergmann cc: Andreas Schwab , , Matthew Wilcox Subject: Re: [PATCH] use size_t for the broken ioctl numbers In-Reply-To: Message-ID: 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: 1086 Lines: 30 On Sun, 7 Sep 2003, Linus Torvalds wrote: > > On Sun, 7 Sep 2003, Arnd Bergmann wrote: > > > > How about changing (sizeof(x)) to (sizeof(x[1]))? > > It will result in "parse error before `['" when x is not > > a type or an array type. > > That sounds like a clever thing to do. Have you tested it with a full > configuration? In fact, what you'd want to do is not just verify that it compiles, but also verify that the object code matches. Because there _is_ one case where adding the [1] will still compile, but generate wrong code: if the "size" argument to the _IOx() was not a type, but a real actual array. Now, that would have been a bug (or at least a misfeature) before too, but the point of this whole thread was that some people used the _IOx() macros incorrectly, so maybe such broken usage actually exists.. 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/