From patchwork Wed Mar 19 08:35:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Eggert X-Patchwork-Id: 331648 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B96852C009A for ; Wed, 19 Mar 2014 19:35:42 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; q=dns; s=default; b= GMTaF2QvB0u/qOC5Qn8ditT8cEouoohaclksBj/XKh2o59fcJ1vHiWb74EwvigDx woK5/7KM1YMQnh7OAohKL7qkjiR30LU7oES83fnluoYys8j2nXxVRllx/2VbUfxi YEpNgDvce1luIca9Cm0+y03m13gUJs5339EZOHj4nk8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; s=default; bh=UpeP pJHIHJ3Z7iavrqodWZFsZKE=; b=EIbCeWDMw84xu4KZJKj3EYnD/pCuVL8Hw8bj jUih6WXswqA7rQFj1DVDrg/LOeMcj/cjkqMcgrpnMub7Osm705kJMvigTpbbxGxE jqGQwHx/NvoBuPf1ZUNRGYY3KSzEGCSdx2VX385ONXCvj15t8QAxRFRsSjJ1s4RS bCeVEu4= Received: (qmail 21812 invoked by alias); 19 Mar 2014 08:35:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 21801 invoked by uid 89); 19 Mar 2014 08:35:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.cs.ucla.edu Message-ID: <532956D4.5020804@cs.ucla.edu> Date: Wed, 19 Mar 2014 01:35:32 -0700 From: Paul Eggert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Mike Frysinger CC: libc-alpha@sourceware.org Subject: Re: [RFC] Make _FILE_OFFSET_BITS=64 default. References: <1393521776-1102-1-git-send-email-reprofy@etersoft.ru> <5322A4AC.2050104@cs.ucla.edu> <20140314181837.GJ184@brightrain.aerifal.cx> <3427802.83HSs9lgGH@vapier> In-Reply-To: <3427802.83HSs9lgGH@vapier> Mike Frysinger wrote: > so wouldn't the right answer be to import the latest gnulib version ? It's better to decouple the issue of altering fts.h from the issue of the _FILE_OFFSET_BITS default. Hardly anybody uses fts.h so this is no big deal. We could leave fts.h alone; all that would happen if the _FILE_OFFSET_BITS default changes is that in theory more compilations would fail, but there'd be no run-time misbehavior. Better, we could install something like the attached patch, independently of any change to the _FILE_OFFSET_BITS default. This patch fixes the bug that one cannot do the following on a 64-bit host: #define _FILE_OFFSET_BITS 64 #include which is an unnecessary restriction, as off_t is 64 bits anyway so should work. If we install the attached patch and change the _FILE_OFFSET_BITS default, the only fts.h compilations that would stop working would be compilations on 32-bit hosts that don't set _FILE_OFFSET_BITS to 32; that's good enough and is probably the least intrusive change that we can easily do. diff --git a/io/fts.h b/io/fts.h index 0a070ba..f71f550 100644 --- a/io/fts.h +++ b/io/fts.h @@ -35,10 +35,12 @@ #include #include -/* The fts interface is incompatible with the LFS interface which - transparently uses the 64-bit file access functions. */ +/* When off_t is not 64 bits, the fts interface is incompatible with + the LFS interface which transparently uses the 64-bit file access + functions. */ #ifdef __USE_FILE_OFFSET64 -# error " cannot be used with -D_FILE_OFFSET_BITS==64" +_Static_assert (sizeof (__off_t) == sizeof (__off64_t), + " cannot be used with 64-bit off_t on this platform"); #endif diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 4d958ea..ebf5588 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -382,6 +382,12 @@ # define __glibc_likely(cond) (cond) #endif +#if (!defined _Static_assert \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L)) +# define _Static_assert(e, s) extern int (*__glibc_Static_assert (void)) \ + [sizeof (struct { unsigned int _error_if_negative: (e) ? 1 : -1; })] +#endif + #include #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH