Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161367AbWHDTFb (ORCPT ); Fri, 4 Aug 2006 15:05:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161366AbWHDTFb (ORCPT ); Fri, 4 Aug 2006 15:05:31 -0400 Received: from terminus.zytor.com ([192.83.249.54]:49875 "EHLO terminus.zytor.com") by vger.kernel.org with ESMTP id S1161367AbWHDTFa (ORCPT ); Fri, 4 Aug 2006 15:05:30 -0400 Message-ID: <44D39A59.5070805@zytor.com> Date: Fri, 04 Aug 2006 12:04:57 -0700 From: "H. Peter Anvin" User-Agent: Thunderbird 1.5.0.4 (X11/20060614) MIME-Version: 1.0 To: Jes Sorensen CC: Andreas Schwab , Alan Cox , Jeff Garzik , ricknu-0@student.ltu.se, linux-kernel@vger.kernel.org, Andrew Morton Subject: Re: [RFC][PATCH] A generic boolean References: <1153341500.44be983ca1407@portal.student.luth.se> <44BE9E78.3010409@garzik.org> <1154702572.23655.226.camel@localhost.localdomain> <44D35B25.9090004@sgi.com> <1154706687.23655.234.camel@localhost.localdomain> <44D36E8B.4040705@sgi.com> <44D370ED.2050605@sgi.com> <44D3753B.1060403@sgi.com> <44D39658.9080007@sgi.com> <44D39735.8010909@zytor.com> <44D398DA.3010206@sgi.com> In-Reply-To: <44D398DA.3010206@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1170 Lines: 31 Jes Sorensen wrote: >> >> And what will break if you make that switch? > > If we are lucky, some binary only modules? :-) > > But you're right, it may just have to be documented as one of those > nasty issues to watch out for. > What is really poisonous is structures which get padded when all the members are naturally aligned. Unfortunately gcc produces really crap code with __attribute__((packed)) on some architectures, so just using that isn't a good solution. On the other hand, non-AEABI ARM sometimes needs it! For the lack of a __attribute__((nopad)) that would throw a warning or error on excessive padding, I fear that our best option is an __abi annotation which would enforce certain rules using sparse, and presumably provide __attribute__((packed)) on ARM: - All padding must be explicit. - All members must be naturally aligned. - No unportable constructs, like non-int-sized bitfields. -hpa - 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/