[LLVMdev] variable sized array
eltoder at gmail.com
Fri Apr 23 14:37:00 PDT 2010
is a C99 way of doing it (and the only standard way), but it's not a legal C++.
On Fri, Apr 23, 2010 at 10:31 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Yuanfang,
>> just a quick question, in llvm::TargetData,
>> uint64_t MemberOffsets; // variable sized array!
>> MemberOffsets has two elements, why it's variable sized ?
> when a StructLayout object is allocated (in TargetData::getStructLayout),
> extra memory is allocated, more than that given by the size of the type.
> The extra memory is interpreted as being part of the MemberOffsets array,
> and is used for storing additional member offsets beyond the first one.
> This kind of trick generates warnings with gcc-4.5. Maybe it can be done
> better. I thought you were supposed to use
> uint64_t MemberOffsets;
> but perhaps I am mistaken.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev