From patchwork Sat Jun 22 12:03:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 253413 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 91A7A2C0421 for ; Sat, 22 Jun 2013 22:03:44 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version; q=dns; s=default; b=IBB868KcI3pEJTOK 0TnydV2n3VoldaFSwGgy8F023DC2A8STWn0WzflnJe7s/zGYHo9NHp6KmrJ2STuV lP6xJUgySYfm9gLq5AsdZyaVXe5kzJWGb0MCezjXuB73VdPzmEBPrSnUGhJqyGpc jFGZaNBUWHVNRxAZ/a3STEwHqrk= 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 :message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version; s=default; bh=fI0UtHWUzRkw+CDQJ2WPeX TAtRo=; b=yJ2KQIPnTil3yI111uVSjk9nP8AQI9U+8pcXrYhKgB0vbMvdf3/rPb eQwYftBR1UxUnOW/+EsNf5by4ij57oWNBIzpKhzK3Sg7KANpfFb0D1y15whXEuQB HprA9gyZd33u58d/4QDE04pMxRfO0dZInkVD32H/bIxTJOER/hMOg= Received: (qmail 31282 invoked by alias); 22 Jun 2013 12:03:38 -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 31255 invoked by uid 89); 22 Jun 2013 12:03:33 -0000 X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from mailout06.t-online.de (HELO mailout06.t-online.de) (194.25.134.19) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 22 Jun 2013 12:03:31 +0000 Received: from fwd09.aul.t-online.de (fwd09.aul.t-online.de ) by mailout06.t-online.de with smtp id 1UqMXQ-0001DQ-IW; Sat, 22 Jun 2013 14:03:28 +0200 Received: from [192.168.0.103] (r3CM9yZH8h51thEUthdvklASyOipkBjWGqHnPaZ0jS5EMohv13zd-vnnSI8kwhnQrz@[84.175.197.220]) by fwd09.t-online.de with esmtp id 1UqMXD-01W2j20; Sat, 22 Jun 2013 14:03:15 +0200 Message-ID: <1371902594.3742.34.camel@yam-132-YW-E178-FTW> Subject: Re: PATCH to add include from system.h From: Oleg Endo To: Jason Merrill Cc: gcc-patches List Date: Sat, 22 Jun 2013 14:03:14 +0200 In-Reply-To: <51C35642.8030600@redhat.com> References: <51C35642.8030600@redhat.com> Mime-Version: 1.0 X-Virus-Found: No On Thu, 2013-06-20 at 15:21 -0400, Jason Merrill wrote: > Since we poison "malloc" and friends in system.h, any C++ code that > includes a standard library header such as , which in turn > includes , will get poisoning errors due to lines like > > > #undef malloc > > using ::malloc; > > The solution is to include before poisoning those identifiers. > > Oleg posted a variant of this patch last year, which included > instead of ; my patch includes both to avoid issues with other > library implementations in which might not declare functions > in the global namespace. > > Tested x86_64-pc-linux-gnu, applying to trunk. Cool, thanks! I've committed the attached patch as rev 200328, which removes the workaround in the SH backend. Cheers, Oleg gcc/ChangeLog: * config/sh/sh.c: Remove workaround. Index: gcc/config/sh/sh.c =================================================================== --- gcc/config/sh/sh.c (revision 200327) +++ gcc/config/sh/sh.c (working copy) @@ -19,12 +19,6 @@ along with GCC; see the file COPYING3. If not see . */ -/* FIXME: This is a temporary hack, so that we can include - below. will try to include which will reference - malloc & co, which are poisoned by "system.h". The proper solution is - to include in "system.h" instead of . */ -#include - #include "config.h" #include "system.h" #include "coretypes.h"