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: 156 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (caibbdcaaahb.dreamhost.com [208.113.200.71]) by wilcox.dreamhost.com (Postfix) with ESMTP id 3905E3600E6 for ; Wed, 19 Mar 2014 01:35:39 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14307373) id DAA82C9F582; Wed, 19 Mar 2014 01:35:38 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx21.g.dreamhost.com 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 homiemail-mx21.g.dreamhost.com (Postfix) with ESMTPS id AD0AF1F5E2D0 for ; Wed, 19 Mar 2014 01:35:38 -0700 (PDT) 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= qBpR37uwMvHJOY0+QfmC2espqTSy18ekY+o7aAM40lfrN+FF83DLNkR5pNSBvJVn XOh+V3P2kTnYwTxTQBXc+3NwUIWOQLUk32Yl+ao9ICi5SZHUVOg9AONm+eo7CZo7 p8Y1fs9MREzlSvw6L+UdKS6NmP0wbM4ElIK7BZe6A48= 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=lPSn1NeO9B+Q8aGFirz9wjzv/gdMFpXbIuon pNOKrgABW38H4w0JBuYcW/q/k2+Py3CeA+FVc8aQTvxw+LtVZ3kGrVR2U8pI8aFg loqYaj/xwLzJQjkBQ/4MSWu4qTiL5L29giQZ54RCiGkwvJo/npWYZtiwmbDZ+iC0 0BPDuig= 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> X-DH-Original-To: glibc@patchwork.siddhesh.in 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