From patchwork Thu Jan 14 12:20:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 10380 Received: (qmail 73312 invoked by alias); 14 Jan 2016 12:20:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 73243 invoked by uid 89); 14 Jan 2016 12:20:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=*file, 2016-01-14 X-HELO: mail-pf0-f178.google.com Received: from mail-pf0-f178.google.com (HELO mail-pf0-f178.google.com) (209.85.192.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 14 Jan 2016 12:20:35 +0000 Received: by mail-pf0-f178.google.com with SMTP id q63so102088248pfb.1 for ; Thu, 14 Jan 2016 04:20:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=HNWlZBygGI1gu93ImNDIX56D/YH5fz+PVek5GG62lRg=; b=f7lYOnNYaKjaDGaN1DNKTFDOC/Sgym4V2AHuk1Srzz7hGsITTuKRRUGH02eFaw/fwQ rXWkNkNEaWxB40o7c1Qv4ydqrcOcBuvRzLDFJWXX7NgFDO6O3xKF0tSbuewW2tuLiVfS ZIQLbYbGq1eMQ00jwkec23s4X9cF6VhseePPalwHXYeO0SpH/AMJJLliW2IUgrQcTVwe E/SlvWqYpmlsi0ADcPs5GCMK0dpZg/+5cAK7sN761AoMuCKn605rnayxrmyRKPbbIiAH 92Oj5oqUGfrYaDTMF3vVA6bp11eSWM3M40BtfKlM+v28de+P/BZhsryGRP1voy8Dq32w UCDQ== X-Gm-Message-State: ALoCoQn6pHu90kT9iZlOFLudjIqbdJLAKkeV8FVUfPKs8LHpCNKeYEVzSzIwXvsz8HXw6xryqvvucSi5A7m0tXgCzUh3b7nsMA== X-Received: by 10.98.69.93 with SMTP id s90mr5294448pfa.77.1452774033976; Thu, 14 Jan 2016 04:20:33 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id v86sm9054345pfa.83.2016.01.14.04.20.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jan 2016 04:20:33 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Fix C++ build error by casting void * Date: Thu, 14 Jan 2016 12:20:24 +0000 Message-Id: <1452774024-12091-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes Two recent patches breaks GDB C++ mode build, https://sourceware.org/ml/gdb-patches/2016-01/msg00150.html https://sourceware.org/ml/gdb-patches/2016-01/msg00086.html gdb/remote.c: In function 'int remote_set_syscall_catchpoint(target_ops*, int, int, int, int, int*)': gdb/remote.c:2036:39: error: invalid conversion from 'void*' to 'char*' [-fpermissive] catch_packet = xmalloc (maxpktsz); ^ gdb/thread.c: In function 'int do_captured_thread_select(ui_out*, void*)': gdb/git/gdb/thread.c:1999:24: error: invalid conversion from 'void*' to 'const char*' [-fpermissive] const char *tidstr = tidstr_v; ^ this patch fixes them by casting void * to the right type. I'll push it in. gdb: 2016-01-14 Yao Qi * remote.c (remote_set_syscall_catchpoint): Cast to char *. * thread.c (do_captured_thread_select): Cast to const char *. --- gdb/remote.c | 2 +- gdb/thread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 8b63708..d5701e3 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -2033,7 +2033,7 @@ remote_set_syscall_catchpoint (struct target_ops *self, big, fallback on the non-selective packet. */ const int maxpktsz = strlen ("QCatchSyscalls:1") + n_sysno * 9 + 1; - catch_packet = xmalloc (maxpktsz); + catch_packet = (char *) xmalloc (maxpktsz); strcpy (catch_packet, "QCatchSyscalls:1"); if (!any_count) { diff --git a/gdb/thread.c b/gdb/thread.c index cdd2a2f..b3b3995 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -1996,7 +1996,7 @@ show_print_thread_events (struct ui_file *file, int from_tty, static int do_captured_thread_select (struct ui_out *uiout, void *tidstr_v) { - const char *tidstr = tidstr_v; + const char *tidstr = (const char *) tidstr_v; struct thread_info *tp; if (ui_out_is_mi_like_p (uiout))