From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9316 invoked by alias); 10 Jun 2013 00:34:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 9302 invoked by uid 89); 10 Jun 2013 00:34:49 -0000 X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS,TW_CX autolearn=ham version=3.3.1 Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com) (209.85.215.173) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 10 Jun 2013 00:34:48 +0000 Received: by mail-ea0-f173.google.com with SMTP id g15so4846671eak.4 for ; Sun, 09 Jun 2013 17:34:46 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.15.36.72 with SMTP id h48mr8494717eev.33.1370824486014; Sun, 09 Jun 2013 17:34:46 -0700 (PDT) Received: by 10.15.36.71 with HTTP; Sun, 9 Jun 2013 17:34:45 -0700 (PDT) In-Reply-To: <1370810089.2365.5.camel@yam-132-YW-E178-FTW> References: <51B0B0ED.5090508@redhat.com> <51B0F122.6020301@redhat.com> <1370810089.2365.5.camel@yam-132-YW-E178-FTW> Date: Mon, 10 Jun 2013 00:34:00 -0000 Message-ID: Subject: Re: [c++-concepts] code review From: Gabriel Dos Reis To: Oleg Endo Cc: Jason Merrill , Andrew Sutton , gcc-patches@gcc.gnu.org, Benjamin Kosnik , Lawrence Crowl , Diego Novillo Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-06/txt/msg00482.txt.bz2 On Sun, Jun 9, 2013 at 3:34 PM, Oleg Endo wrote: > On Thu, 2013-06-06 at 16:29 -0400, Jason Merrill wrote: >> On 06/06/2013 01:47 PM, Andrew Sutton wrote: >> > I never did understand why this happens. Compiling with GCC-4.6, I get >> > these errors originating in logic.cc from an include of . >> > This is what I get: >> > >> > /usr/include/c++/4.6/cstdlib:76:8: error: attempt to use poisoned "calloc" >> >> Ah, I see: adding the include gets the mentions of malloc in before the >> names are poisoned. This change is OK. >> > > I ran into the same issue when I started using C++ std:: stuff in the SH > backend code last year. I posted a patch, but somehow it didn't go > anywhere... > > http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00880.html > > The workaround was to include as the first include in sh.c. > Would it be possible to have the change above also in trunk? > > Cheers, > Oleg > I strongly suggest prefering over for GCC source code base. The reason is that it brings us very little: 1. Not all compilers implement C++93/C++03 semantics on all platforms; in fact even GCC didn't on solaris platforms for example. So, from bootstrapping purposes, we better be on the safer side. 2. C++11 says that the implementation is free to define names in both namespaces (global and std.) If we ever accept C++11 in 5-10 years, we better have something can withstand the evolution. So, my advice is for GCC source code to forget about the headers for the most part. I can see an instance where or would make a difference but given point (1) above, no it doesn't. Just use the traditional headers and be done with it. Maybe I should have included this in our C++ coding standards, but I don't know how Benjamin, Lawrence, and Diego fee about it. -- Gaby