Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Cc: gdb@sourceware.org
Subject: Re: sizeof evaluates expression to compute size?
Date: Thu, 17 Sep 2015 14:19:00 -0000	[thread overview]
Message-ID: <20150917141923.GP4680@adacore.com> (raw)
In-Reply-To: <20150917140949.GA2332@jaguar.corp.atmel.com>

> Evaluation works fine without the cast to char*
> >>> print sizeof(pFoo->arr)
> $2 = 10

Ah, it's the cast that's causing it! I don't remember exactly
what the limitations where in terms of trying to limit those
inferior memory allocations. Perhaps it is a bug indeed. Perhaps
a limitation we'll have to live with.

Your example is not very meaningful, at the moment. You could
just do "print sizeof (char *)" for instance. That will give you
an answer that's different from what the actual size of your
component is (4 or 8 vs 10).

-- 
Joel


      reply	other threads:[~2015-09-17 14:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16 14:41 Senthil Kumar Selvaraj
2015-09-16 14:56 ` Joel Brobecker
2015-09-17 14:10   ` Senthil Kumar Selvaraj
2015-09-17 14:19     ` Joel Brobecker [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=20150917141923.GP4680@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=senthil_kumar.selvaraj@atmel.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