This is the mail archive of the
mailing list for the GCC project.
Re: Issue with sub-object __builtin_object_size
- From: Jason Merrill <jason at redhat dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: jakub at redhat dot com, gcc at gcc dot gnu dot org
- Date: Mon, 15 Sep 2014 14:43:55 -0400
- Subject: Re: Issue with sub-object __builtin_object_size
- Authentication-results: sourceware.org; auth=none
- References: <201409151555 dot s8FFtt2D028642 at d06av02 dot portsmouth dot uk dot ibm dot com>
On 09/15/2014 11:55 AM, Ulrich Weigand wrote:
From the __builtin_object_size documentation, it's not immediately
clear to me whether this is supposed to work or not:
If the least significant
bit is clear, objects are whole variables, if it is set, a closest
surrounding subobject is considered the object a pointer points to.
Is the presence of the above cast (explicit or implicit) supposed to
modify the notion of "closest surrounding subobject"?
IMO, yes. A base class subobject is a subobject, so since the least
significant bit is set, it seems to me that GCC is correctly returning
the size of that subobject.