From patchwork Wed Mar 19 18:04:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Eggert X-Patchwork-Id: 170 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (caibbdcaaahc.dreamhost.com [208.113.200.72]) by wilcox.dreamhost.com (Postfix) with ESMTP id C46AE360087 for ; Wed, 19 Mar 2014 11:05:17 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14307373) id 6683F40E92DC6; Wed, 19 Mar 2014 11:05:17 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx20.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-mx20.g.dreamhost.com (Postfix) with ESMTPS id 3DC6B40CFC108 for ; Wed, 19 Mar 2014 11:05:17 -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= BhFKl9b/ZjdHHFLqL3ylH+rDBv7o+QKmBCutaFWB56YKibRH49ekjIz/g4zGigoy qMPVvHYc2SheeTnWnu1f4mmQjC98EyjyaYYAdaCrcdqgOg8Ci0AdpFhh3VUaEVlR RyH+qi/1sCdTKhSH4wpPTWPFVKCmkfazOlZNYzcfBM8= 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=ygtE LzcU27mk4zCjNlCwyS25Fjo=; b=oTxiYisWL0Dh/HVhUDQUA7uoHJHY833ZfhgW RyaM2f+gAlt11SwdXqTcKU/hXro7zBkxCjbvYgZ7zNFL5ueg45UYPXttmtiuqP+I DarhpqRAFXyRmJMF9m6mHSLpmDgMP7xCcXSIp3Xy29SN+z0VoLB+4ihSTAOXeqGw KXmjFeU= Received: (qmail 22343 invoked by alias); 19 Mar 2014 18:05:15 -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 22318 invoked by uid 89); 19 Mar 2014 18:05:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 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: <5329DC42.2000409@cs.ucla.edu> Date: Wed, 19 Mar 2014 11:04:50 -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> <3427802.83HSs9lgGH@vapier> <532956D4.5020804@cs.ucla.edu> <9842031.PgVxWc0IpI@vapier> In-Reply-To: <9842031.PgVxWc0IpI@vapier> X-DH-Original-To: glibc@patchwork.siddhesh.in On 03/19/2014 02:14 AM, Mike Frysinger wrote: > i have gotten complaints in the past that glibc provided half-baked support > for static assert when building with people happy too:). OK, I'm attaching the patch in more formal form, broken into two parts (one for _Static_assert, one for fts.h, the latter dependent on the former), for further review. I'd like to install it unless further objections turn up. >From 2d6753840038501ff2be16672e5e12e6ff90b0ad Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 19 Mar 2014 11:01:42 -0700 Subject: [PATCH 2/2] fts: allow _FILE_OFFSET_BITS=64 on 64-bit hosts * io/fts.h: Use _Static_assert to check for _FILE_OFFSET_BITS problem, so that we don't unnecessarily reject compilations with _FILE_OFFSET_BITS=64 on 64-bit hosts. --- ChangeLog | 5 +++++ io/fts.h | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d4c88d..834a973 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2014-03-19 Paul Eggert + fts: allow _FILE_OFFSET_BITS=64 on 64-bit hosts + * io/fts.h: Use _Static_assert to check for _FILE_OFFSET_BITS problem, + so that we don't unnecessarily reject compilations with + _FILE_OFFSET_BITS=64 on 64-bit hosts. + Approximate _Static_assert for pre-C11 compilers. * misc/sys/cdefs.h (_Static_assert) [__STDC_VERSION__ < 201112L]: New macro, for convenience with pre-C11 compilers. 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 -- 1.8.5.3