This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sizeof evaluates expression to compute size?


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]