From patchwork Wed Nov 29 13:26:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 24595 Received: (qmail 126957 invoked by alias); 29 Nov 2017 13:26:45 -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 126923 invoked by uid 89); 29 Nov 2017 13:26:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KB_WAM_FROM_NAME_SINGLEWORD, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Nov 2017 13:26:42 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id CEF4F5BA; Wed, 29 Nov 2017 14:26:38 +0100 (CET) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qijcrK+o6Vgp; Wed, 29 Nov 2017 14:26:33 +0100 (CET) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 244AA5B8; Wed, 29 Nov 2017 14:26:30 +0100 (CET) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id vATDQTpq021753; Wed, 29 Nov 2017 14:26:29 +0100 (MET) From: Rainer Orth To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: Fix sol-thread.c compilation on Solaris References: <18ebfbc6-c73a-6aea-7fb8-ad30eef06d1e@redhat.com> Date: Wed, 29 Nov 2017 14:26:29 +0100 In-Reply-To: <18ebfbc6-c73a-6aea-7fb8-ad30eef06d1e@redhat.com> (Pedro Alves's message of "Tue, 28 Nov 2017 14:01:15 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 Hi Pedro, > On 11/28/2017 01:23 PM, Rainer Orth wrote: >> >> # HG changeset patch >> # Parent d3867b61620919242bbc9d875d355487a4e71e96 >> Fix sol-thread.c compilation on Solaris >> >> diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c >> --- a/gdb/sol-thread.c >> +++ b/gdb/sol-thread.c >> @@ -112,7 +112,7 @@ typedef td_err_e (td_ta_get_nthreads_fty >> typedef td_err_e (td_ta_tsd_iter_ftype)(const td_thragent_t *ta_p, >> td_key_iter_f *cb, void *cbdata_p); >> typedef td_err_e (td_ta_thr_iter_ftype)(const td_thragent_t *ta_p, >> - td_thr_iter_f *cb, void *cbdata_p, >> + td_thr_iter_f *cb, const void *cbdata_p, > > Pedantically, I'd think it better that this prototype > continues to match the prototype declared in Solaris's > proc_service.h (...) indeed: has td_err_e td_ta_thr_iter(const td_thragent_t *, td_thr_iter_f *, void *, td_thr_state_e, int, sigset_t *, unsigned); i.e. without the const. >> @@ -1122,7 +1122,7 @@ info_cb (const td_thrhandle_t *th, void >> inferior. */ >> >> static void >> -info_solthreads (char *args, int from_tty) >> +info_solthreads (const char *args, int from_tty) >> { >> p_td_ta_thr_iter (main_ta, info_cb, args, >> TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY, > > (...) which I guess means using '(void *) args' here. WDYT? Makes sense. The resulting patch works just as well. Rainer # HG changeset patch # Parent b50d57495ca9e18f5c34b0bf201f7e7fc7509094 Fix sol-thread.c compilation on Solaris diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -1122,9 +1122,9 @@ info_cb (const td_thrhandle_t *th, void inferior. */ static void -info_solthreads (char *args, int from_tty) +info_solthreads (const char *args, int from_tty) { - p_td_ta_thr_iter (main_ta, info_cb, args, + p_td_ta_thr_iter (main_ta, info_cb, (void *) args, TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY, TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); }