This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: CONSTRUCTOR Confusion about the gccinternals document.


On Wed, 19 Nov 2003, Jim Wilson wrote:
> Chris Lattner wrote:
> > These seem contradictory.  Perhaps only the array case should be
> > initialized to zero?  If not, should the ""Unrepresented fields may be
> > assigned any value." statement be modified?
>
> I think the latter.  store_constructor in expr.c and output_constructor
> in varasm.c are the two main places where constructors are handled.  The
> first one evaluates them at run time, the second one evaluates them at
> compile time.  Both zero out missing fields.
>
> Both also require that fields occur in the same order as they are
> declared.  The C front end lets you initialize fields in any order, but
> the middle end requires that the elements of a CONSTRUCTOR are in order.

Thanks, that's what I thought.  Perhaps the documentation should be
updated?  :)

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/


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