{"id":814315,"url":"http://patchwork.ozlabs.org/api/patches/814315/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/70ca387a-b69a-7d8e-5817-84da2814d639@redhat.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<70ca387a-b69a-7d8e-5817-84da2814d639@redhat.com>","list_archive_url":null,"date":"2017-09-15T15:02:05","name":"[pushed] Fix compile time error when using ansidecl.h with an old version of GCC.","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"5d9c714b73dcaa096d860662066f264dc472202a","submitter":{"id":11459,"url":"http://patchwork.ozlabs.org/api/people/11459/?format=json","name":"Pedro Alves","email":"palves@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/70ca387a-b69a-7d8e-5817-84da2814d639@redhat.com/mbox/","series":[{"id":3325,"url":"http://patchwork.ozlabs.org/api/series/3325/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=3325","date":"2017-09-15T15:02:05","name":"[pushed] Fix compile time error when using ansidecl.h with an old version of GCC.","version":1,"mbox":"http://patchwork.ozlabs.org/series/3325/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/814315/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/814315/checks/","tags":{},"related":[],"headers":{"Return-Path":"<gcc-patches-return-462251-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462251-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"J+6C1xWs\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtzCH3pMpz9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 16 Sep 2017 01:02:19 +1000 (AEST)","(qmail 105349 invoked by alias); 15 Sep 2017 15:02:11 -0000","(qmail 105114 invoked by uid 89); 15 Sep 2017 15:02:11 -0000","from mail-wr0-f173.google.com (HELO mail-wr0-f173.google.com)\n\t(209.85.128.173) by sourceware.org\n\t(qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tFri, 15 Sep 2017 15:02:09 +0000","by mail-wr0-f173.google.com with SMTP id a43so2064070wrc.0 for\n\t<gcc-patches@gcc.gnu.org>; Fri, 15 Sep 2017 08:02:09 -0700 (PDT)","from [192.168.0.123] (bl17-148-124.dsl.telepac.pt.\n\t[188.82.148.124]) by smtp.gmail.com with ESMTPSA id\n\tu35sm1077672wrf.81.2017.09.15.08.02.05 (version=TLS1_2\n\tcipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 15 Sep 2017 08:02:06 -0700 (PDT)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:to:cc\n\t:from:subject:message-id:date:mime-version:content-type; q=dns;\n\ts=default; b=WchU4FEf869yR9E7WDQtPBcAjHci/2tbIVrF2Xx/R4h+Lron+m\n\tlBYoGHYmC9qBQWGtW6S1dwHPTXuod+g+gRHcTGoYE6lDV5KwQT1rlSO9BpjuxN/E\n\tGxuIp9tlgLXBsKCJyroYUtamyR77LkoxpS6ObofjtNT4I9N4ktumHJi3k=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:to:cc\n\t:from:subject:message-id:date:mime-version:content-type; s=\n\tdefault; bh=2ef4+xzVfqeiLZx+wpktdPEqhDM=; b=J+6C1xWsqQMQbKi+PisT\n\tyqO9Xb8pRKVemDsuLykJ2BR9dTKT+GdrDVRMuN3k0WkJ+V35v1MzBn04tr+hr+n+\n\tYQ5bpGyi97vf0N5sHpM2TjrG1gHLYRgqdQwpwk07g4n3TLEBwzqoos7E7SfBeu/n\n\tMOcEWmoF/F38uuLeJNGJmQQ=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-24.0 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tRCVD_IN_DNSWL_NONE,\n\tRCVD_IN_SORBS_SPAM autolearn=ham version=3.3.2 spammy=FINAL,\n\tHX-Received:10.223.174.194, claims","X-HELO":"mail-wr0-f173.google.com","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net;\n\ts=20161025;\n\th=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent\n\t:mime-version; bh=n4SEh39GFzzKvQcPgi3X4TnkRXEQDinhsQjCdvqy8IQ=;\n\tb=M91MRNgoBMIJ6oScu+/pXaT6eBDe0ATig3Hm9ujDv77ffbgBow3luSWycj2VN4Ra+E\n\tyocaMLCtauSyEPvk4ndSViijw1tl/EKeXKjbqx5hmm/6Ct8ndsSKTY2Cdn5i7B8cfnUB\n\t/QZYXnF+v5a0r46DO6k2sC8wRqrvP0GYfrvo9ZeeMEqYOPv+I5wvQGv6ClzjKVU/ar+z\n\t5/Kj34L+sQ65GbnucgmIKX9Bg+FYEVZKRRFloKx5steERhNlgdWU5nmT3qvR1Q2SEi6o\n\tDVMCUvS3s9Qc/p2D1JUu4Ps2heZq7HcN55upJ+lkfg1hIMWkQxRfY5EHvSWeBbNGHD5t\n\tSNbQ==","X-Gm-Message-State":"AHPjjUjrPg6zUNP+5b0U3DAjWO6QgPFmbW0JOsD+kvkvkd0djthE9+Gl\tK9H649DUd2E84WXK","X-Google-Smtp-Source":"AOwi7QAq+t7aiCnaoC5NZEBJvP/mTN5GVfMCcm1Ek5sFjtZNa4xPlS7fq/UqJyDz4yqYAQZB3uv0Lg==","X-Received":"by 10.223.174.194 with SMTP id\n\ty60mr10311128wrc.105.1505487727573;\n\tFri, 15 Sep 2017 08:02:07 -0700 (PDT)","To":"\"gcc-patches@gcc.gnu.org\" <gcc-patches@gcc.gnu.org>,\n\tGDB Patches <gdb-patches@sourceware.org>,\n\t\"binutils@sourceware.org\" <binutils@sourceware.org>","Cc":"Nick Clifton <nickc@redhat.com>","From":"Pedro Alves <palves@redhat.com>","Subject":"[pushed] Fix compile time error when using ansidecl.h with an old\n\tversion of GCC.","Message-ID":"<70ca387a-b69a-7d8e-5817-84da2814d639@redhat.com>","Date":"Fri, 15 Sep 2017 16:02:05 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64;\n\trv:45.0) Gecko/20100101 Thunderbird/45.4.0","MIME-Version":"1.0","Content-Type":"multipart/mixed;\n\tboundary=\"------------625D19BE8DB10F019605502F\""},"content":"Hi guys,\n\nI was looking at merging libiberty&include from gcc to binutils-gdb,\nand noticed this one patch that is in binutils-gdb and not in gcc,\nsince last July.\n\nI think the patch is borderline obvious (it's arguable whether\nto define OVERRIDE/FINAL for C), but in interest of re-syncing\nthe trees, I'm pushing the patch to gcc as is.\n\nThanks,\nPedro Alves","diff":"From 47ba729a29c6fa2283835d95d2ab5695d8c5d732 Mon Sep 17 00:00:00 2001\nFrom: Nick Clifton <nickc@redhat.com>\nDate: Mon, 31 Jul 2017 15:08:32 +0100\nSubject: [PATCH] Fix compile time error when using ansidecl.h with an old\n version of GCC.\n\n\tBinutils PR 21850\n\t* ansidecl.h (OVERRIDE): Protect check of __cplusplus value with\n\t#idef __cplusplus.\n---\n include/ChangeLog  |  6 ++++++\n include/ansidecl.h | 30 ++++++++++++++++++------------\n 2 files changed, 24 insertions(+), 12 deletions(-)\n\ndiff --git a/include/ChangeLog b/include/ChangeLog\nindex c7ce259..4703588 100644\n--- a/include/ChangeLog\n+++ b/include/ChangeLog\n@@ -8,6 +8,12 @@\n \t* simple-object.h (simple_object_copy_lto_debug_sections): New\n \tfunction.\n \n+2017-07-31  Nick Clifton  <nickc@redhat.com>\n+\n+\tBinutils PR 21850\n+\t* ansidecl.h (OVERRIDE): Protect check of __cplusplus value with\n+\t#idef __cplusplus.\n+\n 2017-07-02  Jan Kratochvil  <jan.kratochvil@redhat.com>\n \n \t* dwarf2.def (DW_IDX_compile_unit, DW_IDX_type_unit, DW_IDX_die_offset)\ndiff --git a/include/ansidecl.h b/include/ansidecl.h\nindex f6e1761..ab3b895 100644\n--- a/include/ansidecl.h\n+++ b/include/ansidecl.h\n@@ -334,22 +334,28 @@ So instead we use the macro below and test it against specific values.  */\n    For gcc, use \"-std=c++11\" to enable C++11 support; gcc 6 onwards enables\n    this by default (actually GNU++14).  */\n \n-#if __cplusplus >= 201103\n-/* C++11 claims to be available: use it.  final/override were only\n-   implemented in 4.7, though.  */\n-# if GCC_VERSION < 4007\n+#if defined __cplusplus\n+# if __cplusplus >= 201103\n+   /* C++11 claims to be available: use it.  Final/override were only\n+      implemented in 4.7, though.  */\n+#  if GCC_VERSION < 4007\n+#   define OVERRIDE\n+#   define FINAL\n+#  else\n+#   define OVERRIDE override\n+#   define FINAL final\n+#  endif\n+# elif GCC_VERSION >= 4007\n+   /* G++ 4.7 supports __final in C++98.  */\n #  define OVERRIDE\n-#  define FINAL\n+#  define FINAL __final\n # else\n-#  define OVERRIDE override\n-#  define FINAL final\n+   /* No C++11 support; leave the macros empty.  */\n+#  define OVERRIDE\n+#  define FINAL\n # endif\n-#elif GCC_VERSION >= 4007\n-/* G++ 4.7 supports __final in C++98.  */\n-# define OVERRIDE\n-# define FINAL __final\n #else\n-/* No C++11 support; leave the macros empty: */\n+  /* No C++11 support; leave the macros empty.  */\n # define OVERRIDE\n # define FINAL\n #endif\n-- \n2.5.5\n\n","prefixes":["pushed"]}