[cfe-dev] ConstantArrayType's size is not always of pointer width

Sebastian Redl sebastian.redl at getdesigned.at
Tue Dec 2 09:03:29 PST 2008


Eli Friedman wrote:
> On Tue, Dec 2, 2008 at 8:51 AM, Sebastian Redl
> <sebastian.redl at getdesigned.at> wrote:
>   
>> Hmm ... looking at the code that creates the type (SemaType.cpp:391),
>> the array size is in fact always 32 bits wide. This definitely looks
>> like a bug.
>>     
>
> No, it's not; it's just using the width of the constant for the array
> size; isIntegerConstantExpr overwrites the given width.
>   
Ah, OK. But is using the width of the constant the right thing to do? 
Shouldn't an array size ultimately be of type size_t?

Sebastian



More information about the cfe-dev mailing list