From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83747 invoked by alias); 5 Aug 2015 13:51:40 -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 83730 invoked by uid 89); 5 Aug 2015 13:51:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 05 Aug 2015 13:51:39 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id E8031353829; Wed, 5 Aug 2015 13:51:37 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t75DpakY004534; Wed, 5 Aug 2015 09:51:36 -0400 Message-ID: <55C214E7.6090506@redhat.com> Date: Wed, 05 Aug 2015 13:51:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ulrich Weigand CC: Doug Evans , gdb-patches Subject: Re: [PATCH v2] C++: dlsym casts in gdb/linux-thread-db.c and gdb/gdbserver/thread-db.c References: <20150805133424.7C1181704@oc7340732750.ibm.com> In-Reply-To: <20150805133424.7C1181704@oc7340732750.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-SW-Source: 2015-08/txt/msg00111.txt.bz2 On 08/05/2015 02:34 PM, Ulrich Weigand wrote: > Pedro Alves wrote: > >> gdb/ChangeLog: >> 2015-08-03 Pedro Alves >> >> * nat/gdb_thread_db.h (td_init_ftype, td_ta_new_ftype) >> (td_ta_map_lwp2thr_ftype, td_ta_thr_iter_ftype) >> (td_ta_event_addr_ftype, td_ta_set_event_ftype) >> (td_ta_clear_event_ftype, td_ta_event_getmsg_ftype) >> (td_thr_validate_ftype, td_thr_get_info_ftype) >> (td_thr_event_enable_ftype, td_thr_tls_get_addr_ftype) >> (td_thr_tlsbase_ftype, td_symbol_list_ftype, td_ta_delete_ftype): >> New typedefs. > > This breaks the build for me with: > > In file included from /home/uweigand/dailybuild/spu-tc-2015-08-04/binutils-gdb-head/binutils-gdb/gdb/gdbserver/thread-db.c:31: > /home/uweigand/dailybuild/spu-tc-2015-08-04/binutils-gdb-head/binutils-gdb/gdb/gdbserver/../nat/gdb_thread_db.h:20: error: redefinition of typedef ‘td_init_ftype’ > /home/uweigand/dailybuild/spu-tc-2015-08-04/binutils-gdb-head/binutils-gdb/gdb/gdbserver/../nat/gdb_thread_db.h:20: error: previous declaration of ‘td_init_ftype’ was here > /home/uweigand/dailybuild/spu-tc-2015-08-04/binutils-gdb-head/binutils-gdb/gdb/gdbserver/../nat/gdb_thread_db.h:23: error: redefinition of typedef ‘td_ta_new_ftype’ > /home/uweigand/dailybuild/spu-tc-2015-08-04/binutils-gdb-head/binutils-gdb/gdb/gdbserver/../nat/gdb_thread_db.h:23: error: previous declaration of ‘td_ta_new_ftype’ was here > [... etc for each of the typedefs ...] > > It seems this is caused by the nat/gdb_thread_db.h header file > being included twice into gdbserver/thread-db.c: > > 1) via line 23: > #include "linux-low.h" > (which includes "nat/gdb_thread_db.h" at line 20) > > 2) directly in line 30: > #include "nat/gdb_thread_db.h" > > and the file not being guarded against double inclusion. Yeah, I think we should just add the guards. Are you already taking care of that, or would you like me to? > > (I'm not 100% sure whether an identical second typedef is supposed > to be valid C or not, but at least my GCC 4.1 host compiler rejects > it in this case.) Thanks, Pedro Alves