From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0YU+Fb6MdWARMgAAWB0awg (envelope-from ) for ; Tue, 13 Apr 2021 08:21:18 -0400 Received: by simark.ca (Postfix, from userid 112) id 3CCC31F104; Tue, 13 Apr 2021 08:21:18 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=MAILING_LIST_MULTI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5891E1E783 for ; Tue, 13 Apr 2021 08:21:17 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D77BA3854833; Tue, 13 Apr 2021 12:21:16 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 701483854804 for ; Tue, 13 Apr 2021 12:21:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 701483854804 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 90645AC79; Tue, 13 Apr 2021 12:21:13 +0000 (UTC) Date: Tue, 13 Apr 2021 14:21:10 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb] Fix regoff_t incompatibility Message-ID: <20210413122108.GA12141@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Tromey Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Hi, I did an experiment with importing the regex module in gnulib, and trying to build gdb. The first problem I ran into was that: - regoff_t was defined as long int, and - the address of a regoff_t variable i in ui_file_style::parse was passed as int * to function extended_color. Fix this by changing the types of some function parameters of functions read_semi_number and extended_color from int * to regoff_t *. Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb] Fix regoff_t incompatibility gdb/ChangeLog: 2021-04-13 Tom de Vries * ui-style.c (read_semi_number, extended_color): Change idx parameter type to regoff_t *. --- gdb/ui-style.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/ui-style.c b/gdb/ui-style.c index 7deb4ac363f..2fda9d13fd3 100644 --- a/gdb/ui-style.c +++ b/gdb/ui-style.c @@ -169,7 +169,7 @@ ui_file_style::to_ansi () const characters read and put the number into *NUM. */ static bool -read_semi_number (const char *string, int *idx, long *num) +read_semi_number (const char *string, regoff_t *idx, long *num) { if (string[*idx] != ';') return false; @@ -186,7 +186,7 @@ read_semi_number (const char *string, int *idx, long *num) sequence; that is, and 8- or 24- bit color. */ static bool -extended_color (const char *str, int *idx, ui_file_style::color *color) +extended_color (const char *str, regoff_t *idx, ui_file_style::color *color) { long value;