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.


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.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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