From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YXgkEow2xGhqkAEAWB0awg (envelope-from ) for ; Fri, 12 Sep 2025 11:04:44 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=yfGUuc9o; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 45AC61E04C; Fri, 12 Sep 2025 11:04:44 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B3F4F1E04C for ; Fri, 12 Sep 2025 11:04:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4FC273857B9E for ; Fri, 12 Sep 2025 15:04:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FC273857B9E Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=yfGUuc9o Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id 446AA3858D21 for ; Fri, 12 Sep 2025 15:04:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 446AA3858D21 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 446AA3858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757689452; cv=none; b=gm4LlueWsmXVRBf/hGZQouVffmW6rdiRPuSfefLJPikDl8eZGA7EQwKvQfBixAqFybofsORbrJn2eUqyncJOjaLKCFV1koW18xxedD45kBzmlwof1AakgeDpycOBGMWFBbsU679Z6yH+x0P8RBLN43Vd0lFIcUbEI5snJ+f7ymY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757689452; c=relaxed/simple; bh=rpYGj5fHYrCnhUsNxCZS1oDCNA7LdPa2VtIK6fKM7Ks=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=do8G6BAH+RwR+ruEd1Uz2YqfEI6mfX1rd6G2HSeVZCgl/iXJkIRfUDJBmX4hdMIc7MsUDOQsvEYCFarUdN+HwyTloIi/LOp+FEF/KDmLIGqxJZohhxU6VIS60kN9O/S6GYsqBQqwU2JlSfqlBugLMU7PLts5Rs1ehI79P2Ac5pg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 446AA3858D21 Received: from eig-obgw-5003b.ext.cloudfilter.net ([10.0.29.155]) by cmsmtp with ESMTPS id x2lauI1SpSkcfx5JsuPH6d; Fri, 12 Sep 2025 15:04:12 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id x5JruDBoK9MM8x5JruowFM; Fri, 12 Sep 2025 15:04:11 +0000 X-Authority-Analysis: v=2.4 cv=Xf6JzJ55 c=1 sm=1 tr=0 ts=68c4366b a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=yJojWOMRYYMA:10 a=ItBw4LHWJt0A:10 a=2rlLS1JVAAAA:8 a=zstS-IiYAAAA:8 a=SttrjXcOB2AXXrrzBYIA:9 a=-y79GXfwoCjg1VU16VqY:22 a=4G6NA9xxw8l3yy4pmD5M:22 a=VS4QxaUSPT0UtbFnIvSC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Kxa7aReJuxpR8bsUHZdve1pLChOahCyHNDdwzVqpeCU=; b=yfGUuc9o4JfLkqEumh+pZM/xFC 29We3AX/920S4xteNvU0ThhoM6PsoczN+YTsqnEj+gyimnroQczJJFGJqSmtfP686qaUcPdqKtKhb f37nuQNJvbLZZHKs7l7QGVcfh; Received: from 97-122-110-68.hlrn.qwest.net ([97.122.110.68]:51596 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1ux5Jq-00000003PuM-3dB0; Fri, 12 Sep 2025 09:04:10 -0600 From: Tom Tromey To: Ciaran Woodward Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/1] gdb/tui: Fix build for older ncurses In-Reply-To: <20250911183021.17844-1-ciaranwoodward@xmos.com> (Ciaran Woodward's message of "Thu, 11 Sep 2025 19:30:21 +0100") References: <20250911183021.17844-1-ciaranwoodward@xmos.com> X-Attribution: Tom Date: Fri, 12 Sep 2025 09:04:09 -0600 Message-ID: <878qijogpi.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.110.68 X-Source-L: No X-Exim-ID: 1ux5Jq-00000003PuM-3dB0 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-68.hlrn.qwest.net (bapiya) [97.122.110.68]:51596 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfMclU7PYoQ8hSh0maUOlbmEziY9URfSZyfPbyS0fH+a7p3YmCnzk6JVyi0Cz/s54BgihVmW/iYz05J4+p57TNp0zVAPAjQRECxpwA/zyxGk3Xbk4VtBt S98Ay9ZzO9mmVTemsVlvhYxX5bOmsz4ISJ1Nbaa54RthuL4wSZHtma0QDCi2fLn0GM0/+cW5mMmzdrQE4lXmDCbFDRACJXE+33A= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> "Ciaran" == Ciaran Woodward writes: Ciaran> Older versions of ncurses (including the version that ships inside Ciaran> macos, and Centos 7) do not include the A_ITALIC macro. This patch Ciaran> simply hides any use of A_ITALIC behind a preprocessor guard. Thanks for doing this. Ciaran> The result of this is that italics won't be rendered in the tui Ciaran> if ncurses isn't supported. We do have other options if we think Ciaran> it's important - for instance we could show italics as bold if Ciaran> italics aren't supported. From my understanding, that might be Ciaran> overthinking it - so I took the simplest approach here, just to Ciaran> fix the build. Seems reasonable enough. Ciaran> Those versions also define tgetnum as: Ciaran> int tgetnum(char *id); Ciaran> so attempting to compile for c++ results in the error: Ciaran> ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings] Ciaran> diff --git a/gdb/ui-style.c b/gdb/ui-style.c Ciaran> index 9a58e4dd2ae..ccc9094ca59 100644 Ciaran> --- a/gdb/ui-style.c Ciaran> +++ b/gdb/ui-style.c Ciaran> @@ -594,7 +594,7 @@ colorsupport () Ciaran> { Ciaran> std::vector result = {color_space::MONOCHROME}; Ciaran> - int colors = tgetnum ("Co"); Ciaran> + int colors = tgetnum (const_cast ("Co")); Would you mind adding a comment here explaining the need for the cast and also for which version of curses it was found to be needed? I think that may help future developers. Anyway ok with this change. Approved-By: Tom Tromey Tom