From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH][gdb] Fix regoff_t incompatibility
Date: Tue, 13 Apr 2021 14:21:10 +0200 [thread overview]
Message-ID: <20210413122108.GA12141@delia> (raw)
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 <tdevries@suse.de>
* 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;
next reply other threads:[~2021-04-13 12:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 12:21 Tom de Vries [this message]
2021-04-13 12:39 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210413122108.GA12141@delia \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox