From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21535 invoked by alias); 11 Feb 2015 10:09:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 21512 invoked by uid 89); 11 Feb 2015 10:08:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pa0-f54.google.com Received: from mail-pa0-f54.google.com (HELO mail-pa0-f54.google.com) (209.85.220.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 11 Feb 2015 10:08:55 +0000 Received: by mail-pa0-f54.google.com with SMTP id kx10so2974877pab.13 for ; Wed, 11 Feb 2015 02:08:53 -0800 (PST) X-Received: by 10.66.141.176 with SMTP id rp16mr45706351pab.11.1423649333815; Wed, 11 Feb 2015 02:08:53 -0800 (PST) Received: from [127.0.0.1] (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id n10sm471907pdp.18.2015.02.11.02.08.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 02:08:53 -0800 (PST) Message-ID: <54DB2A32.1030109@gmail.com> Date: Wed, 11 Feb 2015 10:09:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Pedro Alves CC: gdb-patches@sourceware.org Subject: Re: [PATCH 05/36] Fix redefinition errors in C++ mode References: <1423524046-20605-1-git-send-email-palves@redhat.com> <1423524046-20605-6-git-send-email-palves@redhat.com> In-Reply-To: <1423524046-20605-6-git-send-email-palves@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00297.txt.bz2 On 09/02/15 23:20, Pedro Alves wrote: > The intent of static here is naturally to avoid making these objects > visible outside the compilation unit. The equivalent in C++ would be > to instead define the objects in the anonymous namespace. But given > that it's desirable to leave the codebase compiling as both C and C++ > for a while, this just makes the objects extern. It is a little pity to do so, but I don't know any other better way. The patch looks good to me. > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index 2804453..006acef 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -299,7 +299,7 @@ static int strace_marker_p (struct breakpoint *b); > > /* The abstract base class all breakpoint_ops structures inherit > from. */ > -struct breakpoint_ops base_breakpoint_ops; > +extern struct breakpoint_ops base_breakpoint_ops; > looks base_breakpoint_ops has been declared in breakpoint.h, so we can just remove it here. -- Yao