Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S267324AbUIOSOM (ORCPT ); Wed, 15 Sep 2004 14:14:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267230AbUIOSKH (ORCPT ); Wed, 15 Sep 2004 14:10:07 -0400 Received: from fw.osdl.org ([65.172.181.6]:16608 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S267301AbUIOSJR (ORCPT ); Wed, 15 Sep 2004 14:09:17 -0400 Date: Wed, 15 Sep 2004 11:09:08 -0700 (PDT) From: Linus Torvalds To: Nikita Danilov cc: =?iso-8859-1?Q?J=F6rn?= Engel , Kernel Mailing List Subject: Re: Being more anal about iospace accesses.. In-Reply-To: <16712.32725.515306.890990@thebsh.namesys.com> Message-ID: References: <20040915165450.GD6158@wohnheim.fh-wedel.de> <16712.32725.515306.890990@thebsh.namesys.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: 598 Lines: 21 On Wed, 15 Sep 2004, Nikita Danilov wrote: > > Unfortunately it breaks even better identity > > foo *p; > > p + nr == (foo *)((char *)p + nr * sizeof *p) No, gcc allows the above, by making sizeof(void) be 1. And sane compilers would just inform the user at compile-time with a nice readable message that he's doing something stupid. 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/