This is the mail archive of the gcc-patches@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 Thu, 2003-11-20 at 13:03, Chris Lattner wrote:
> Thanks, that's what I thought.  Perhaps the documentation should be
> updated?  :)

Like so?  Comments anyone?

2003-11-30  James E Wilson  <wilson@specifixinc.com>

	* doc/c-tree.texi (CONSTRUCTOR): Clarify element order and handling
	of missing fields.

Index: c-tree.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/c-tree.texi,v
retrieving revision 1.47
diff -p -r1.47 c-tree.texi
*** c-tree.texi	22 Sep 2003 05:09:24 -0000	1.47
--- c-tree.texi	1 Dec 2003 07:49:05 -0000
*************** second operand is a @code{TREE_LIST}.  I
*** 2234,2243 ****
  @code{CONSTRUCTOR} is a @code{RECORD_TYPE} or @code{UNION_TYPE}, then
  the @code{TREE_PURPOSE} of each node in the @code{TREE_LIST} will be a
  @code{FIELD_DECL} and the @code{TREE_VALUE} of each node will be the
! expression used to initialize that field.  You should not depend on the
! fields appearing in any particular order, nor should you assume that all
! fields will be represented.  Unrepresented fields may be assigned any
! value.
  
  If the @code{TREE_TYPE} of the @code{CONSTRUCTOR} is an
  @code{ARRAY_TYPE}, then the @code{TREE_PURPOSE} of each element in the
--- 2234,2240 ----
  @code{CONSTRUCTOR} is a @code{RECORD_TYPE} or @code{UNION_TYPE}, then
  the @code{TREE_PURPOSE} of each node in the @code{TREE_LIST} will be a
  @code{FIELD_DECL} and the @code{TREE_VALUE} of each node will be the
! expression used to initialize that field.
  
  If the @code{TREE_TYPE} of the @code{CONSTRUCTOR} is an
  @code{ARRAY_TYPE}, then the @code{TREE_PURPOSE} of each element in the
*************** again, the @code{TREE_VALUE} is the corr
*** 2247,2254 ****
  @code{TREE_PURPOSE} is @code{NULL_TREE}, then the initializer is for the
  next available array element.
  
! Conceptually, before any initialization is done, the entire area of
! storage is initialized to zero.
  
  @item COMPOUND_LITERAL_EXPR
  @findex COMPOUND_LITERAL_EXPR_DECL_STMT
--- 2244,2253 ----
  @code{TREE_PURPOSE} is @code{NULL_TREE}, then the initializer is for the
  next available array element.
  
! In the front end, you should not depend on the fields appearing in any
! particular order.  However, in the middle end, fields must appear in
! declaration order.  You should not assume that all fields will be
! represented.  Unrepresented fields will be set to zero.
  
  @item COMPOUND_LITERAL_EXPR
  @findex COMPOUND_LITERAL_EXPR_DECL_STMT
-- 
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]