From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126395 invoked by alias); 5 Aug 2015 13:34:35 -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 126384 invoked by uid 89); 5 Aug 2015 13:34:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: e06smtp17.uk.ibm.com Received: from e06smtp17.uk.ibm.com (HELO e06smtp17.uk.ibm.com) (195.75.94.113) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 05 Aug 2015 13:34:33 +0000 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 5 Aug 2015 14:34:29 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 5 Aug 2015 14:34:27 +0100 X-MailFrom: uweigand@de.ibm.com X-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 3993B1B0806B for ; Wed, 5 Aug 2015 14:35:49 +0100 (BST) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t75DYQIs39125132 for ; Wed, 5 Aug 2015 13:34:26 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t75DYPbs009216 for ; Wed, 5 Aug 2015 07:34:25 -0600 Received: from oc7340732750.ibm.com (icon-9-167-246-65.megacenter.de.ibm.com [9.167.246.65]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t75DYP1H009207; Wed, 5 Aug 2015 07:34:25 -0600 Received: by oc7340732750.ibm.com (Postfix, from userid 500) id 7C1181704; Wed, 5 Aug 2015 15:34:24 +0200 (CEST) Subject: Re: [PATCH v2] C++: dlsym casts in gdb/linux-thread-db.c and gdb/gdbserver/thread-db.c To: palves@redhat.com (Pedro Alves) Date: Wed, 05 Aug 2015 13:34:00 -0000 From: "Ulrich Weigand" Cc: dje@google.com (Doug Evans), gdb-patches@sourceware.org (gdb-patches) In-Reply-To: <55BFC0D8.7040309@redhat.com> from "Pedro Alves" at Aug 03, 2015 08:28:24 PM MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-Id: <20150805133424.7C1181704@oc7340732750.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15080513-0029-0000-0000-000005C1CC50 X-SW-Source: 2015-08/txt/msg00107.txt.bz2 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. (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.) Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com