Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [RFA] Cast char constant to int in sizeof.exp
Date: Wed, 06 Sep 2017 14:29:00 -0000	[thread overview]
Message-ID: <8469ee61-e832-da46-07e8-2b1ff19eb58f@redhat.com> (raw)
In-Reply-To: <20170906045306.13440-1-tom@tromey.com>

On 09/06/2017 05:53 AM, Tom Tromey wrote:
> PR gdb/22010 concerns a regression I introduced with the scalar
> printing changes.  The bug is that this code in sizeof.exp:
> 
>     set signof_byte [get_integer_valueof "(int) '\\377'" -1]

The cast shouldn't be here in the log.  The cast is what fixes it.

> 
> can incorrectly compute sizeof_byte.  One underlying problem here is
> that gdb's C parser doesn't treat a char constant as an int (this is
> PR 19973).
> 
> However, it seems good to have an immediate fix for the regression.
> The simplest is to cast to an int here.
> 
> testsuite/ChangeLog
> 2017-09-05  Tom Tromey  <tom@tromey.com>
> 
> 	PR gdb/22010:
> 	* gdb.base/sizeof.exp (check_valueof): Cast char constant to int.

OK.

Thanks,
Pedro Alves


      reply	other threads:[~2017-09-06 14:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06  4:53 Tom Tromey
2017-09-06 14:29 ` Pedro Alves [this message]

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=8469ee61-e832-da46-07e8-2b1ff19eb58f@redhat.com \
    --to=palves@redhat.com \
    --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