From: John Levon Subject: Re: [PATCH] Partial fix for compat build non-portability Date: Wed, 10 Jan 2007 18:30:40 +0000 Message-ID: <20070110183040.GA1588@totally.trollied.org.uk> References: <20070110173719.GA31121@totally.trollied.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Wed, Jan 10, 2007 at 06:21:05PM +0000, Keir Fraser wrote: > > Still to be resolved is the pragma pack push issue; this is non-portable > > pragma only enabled on some targets, as it's intended for win32 > > compatibility not something for general use. We should be wrapping each > > structure in a pragma pack(4) / pragma pack() pair, but trying to fix > > that makes my head hurt, and Jan isn't interested. > > We only care about it working for the x86/64 target since that's the only > one that asserts CONFIG_COMPAT. Why would wrapping structs individually be > better than wrapping whole header files? Jan was concerned that just using #pragma pack(4) ... #pragma pack() wouldn't work if an included header file used pragma. From the docs it seems that #pragma pack() will reset to the default rather than what was last pushed. One simple thing might just to be follow every #include in the compat headers with another #pragma pack(4)? regards john