From patchwork Thu Jul 26 14:01:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 949692 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-482447-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="J2oFM86W"; dkim-atps=neutral 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 41bv1g6c2fz9s29 for ; Fri, 27 Jul 2018 00:02:47 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id; q=dns; s=default; b=K5GRDIft6yBDKaP zcba8mxKu0B8PHW52RCmp188VVJ0ORtC3CcejIHrCVgyr58U5aFnUz0g6STH/coQ v64nxrCIMNHlN9ZT2H5iyhU6CXKO3nE9TsCu2a8W+yaOi9Q3dC1E76aXTBeOvMTf veDDnxhhZWLrMgFT36/2AeABjQdk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id; s=default; bh=D2wkF758uIUyyobxAMqRD ZHDUkQ=; b=J2oFM86WLdBBZEhSmxRY/zLUlpe5pyM8XwNt3uWqsvrX8nXZV9URc 7qKdOWlii0v7v2FxrFzOcljCqlGuQFwGysKlmvx/vY+Goc5mpiEUXkv/YNgvKels OYgM1cP3yCaS4SsdycGx8e3rJ4x1JMi5sTuflRxsk3M1LQGPqxRZ4Q= Received: (qmail 71736 invoked by alias); 26 Jul 2018 14:02:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 71637 invoked by uid 89); 26 Jul 2018 14:02:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, KAM_NUMSUBJECT, SPF_HELO_PASS autolearn=no version=3.3.2 spammy=sk:_GLIBCX, sk:_glibcx, Hx-languages-length:1823, char_traits X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Jul 2018 14:02:08 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF8A540216E3; Thu, 26 Jul 2018 14:02:06 +0000 (UTC) Received: from localhost (unknown [10.33.36.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id 929C17C2C; Thu, 26 Jul 2018 14:02:06 +0000 (UTC) From: jwakely@redhat.com To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH 0/8] Reduce/remove dependencies on _GLIBCXX_USE_C99_STDINT_TR1 Date: Thu, 26 Jul 2018 15:01:49 +0100 Message-Id: From: Jonathan Wakely Currently huge swathes of the library are only enabled conditionally by: #ifdef _GLIBCXX_USE_C99_STDINT_TR1 This macro was created as part of the TR1 implementation, to detect whether the C++98 compiler has access to a working header from C99. In C++11 that header is required, and may even be provided by GCC itself. Having a large portion of the C++11 library depend on a feature that is almost guaranteed to be present for C++11 just complicates and obfuscates the code. There are also a number of places that use features that depend on the macro, but aren't guarded by the macro. This means if the macro were to be undefined for some target, the library wouldn't even build! Several of the dependencies turn out to be unnecessary. For example every instantiation of strings and streams using char16_t was guarded by the macro, because char_traits wants to use std::uint_least16_t (and similarly for char32_t). We can define good-enough char_traits specializations even if the types are not available. Every use of is guarded by the macro, because depends on and that uses std::intmax_t and std::uintmax_t. By defining those two types in even when we don't have a working we can define most of the C++11 concurrency library unconditionally (or to be only conditional on _GLIBCXX_HAS_GTHREADS). The remaining dependencies are related to , which makes heavy use of the types. I haven't tried to do anything about that, but have added some missing checks for the macro, and some missing dg-require-cstdint directives to tests that depend on or . Tested powerpc64le-linux, committed to trunk.