/* defglobal - define a global or static variable in segment seg */
   swtoseg(p->u.seg = seg);
   if (p->sclass != STATIC)
      swtoseg(p->u.seg);
/* defpointer - initialize a pointer to p or to 0 if p==0 */
/* doconst - generate a variable for an out-of-line constant */
   if (p->u.c.loc) {
      defglobal(p->u.c.loc, p->u.c.loc->u.seg ? p->u.c.loc->u.seg : 
                  (p->shared)? GSDATA : DATA /*was: LIT*/ );    /*CWK 950320*/
      if (isarray(p->type))
         defstring(p->type->size, p->u.c.v.p);
         defconst(ttob(p->type), p->u.c.v, 0);
      p->u.c.loc->defined = 1;
      p->u.c.loc = 0;
/* genasgn - append tree for assignment of e to evolving structure expression in *sp */
   sp->off = roundup(sp->off, e->type->size);
   p = simplify(ADD+P, ptr(e->type), lvalue(idnode(sp->var)), constnode(sp->off, inttype));
   if (isarray(e->type)) {
      p = tree(ASGN+B, e->type, p, e);
      p->u.sym = intconst(e->type->size);
      p = asgnnode(ASGN, retype(rvalue(p), e->type), e);
   sp->tree = tree(RIGHT, voidtype, sp->tree, p);
   sp->off += e->type->size;
   return e->type->size;
/* genchar - generate assignment of string constant p to array in *sp */
   char *s = p->u.c.v.p;
   for (n = p->type->size; n > 0 && sp->off%inttype->align; n--)
      Type ty = array(chartype, p->type->size - (s - p->u.c.v.p), 0);
      v.p = stringn(s, ty->size);
      if (p->u.c.loc == 0)
         p->u.c.loc = genident(STATIC, ty, GLOBAL);
      e->u.sym = p->u.c.loc;
      e->u.sym = intconst(ty->size);
/* genconst - generate/check constant expression e; return size */
      switch (generic(e->op)) {
            defaddress(e->u.sym);
         return e->type->size;
         if (e->op == CNST+P && isarray(e->type)) {
           if (sy && sy->shared)      /* 980720*/
            defconst(ttob(e->type), e->u.v, 1);
            defconst(ttob(e->type), e->u.v, 0);
         return e->type->size;
         assert(e->kids[0] || e->kids[1]);
         if (e->kids[1] && e->kids[0])
         e = e->kids[1] ? e->kids[1] : e->kids[0];
         if (isarith(e->type))
               e->kids[0]->type, e->type);
         e = e->kids[0];
         return inttype->size;
/* genspace - generate n bytes of space or 0's */
   else if (n <= inttype->size)
      for ( ; n > 0; n--)
         zeros->sclass = STATIC;
         zeros->type = array(chartype, n, 0);
         zeros->generated = 1;
      if (n > zeros->type->size)
         zeros->type = array(chartype, n, 0);
      e = tree(INDIR+B, zeros->type, idnode(zeros), 0);
      e->u.sym = intconst(n);
/* initarray - initialize array of ty of <= len bytes; if len == 0, go to } */
      n += ty->size;
/* initchar - initialize array of <= len ty characters; if len == 0, go to } */
               e->type, ty);
         *s++ = initvalue(ty)->u.v.sc;
         if (++n%inttype->size == 0) {
            defstring(inttype->size, buf);
      defstring(s - buf, buf);
/* initend - finish off an initialization at level lev; accepts trailing comma */
/* initfields - initialize <= an unsigned's worth of bit fields in fields p to q */
         if (fieldsize(p) < 8*p->type->size)
         if (p->link == q)
         p = p->link;
      if (q && (n = q->offset - p->offset) < unsignedtype->size)
         for (i = n - 1; i >= 0; i--) {
               constnode(8*(unsignedtype->size - n + i), inttype));
      i = initvalue(inttype)->u.v.i;
      if (fieldsize(p) < 8*p->type->size) {
         if (p->type == inttype && i >= 0 && (i&~(fieldmask(p)>>1)) !=  0
         ||  p->type == inttype && i <  0 && (i| (fieldmask(p)>>1)) != ~0
         ||  p->type == unsignedtype      && (i& ~fieldmask(p)))
            warning("initializer exceeds bit-field width\n");
      if (p->to > n)
         n = p->to;
      if (p->link == q)
      p = p->link;
      v.uc = bits>>(8*(unsignedtype->size - 1));
/* initglobal - a new global identifier p, possibly initialized */
      if (p->sclass == STATIC) {
         for (ty = p->type; isarray(ty); ty = ty->type)
         defglobal(p, /*isconst(ty) ? LIT : */ ( (p->shared)? GSDATA:DATA));  /*CWK*/
         defglobal(p, (p->shared)? GSDATA:DATA);  /*CWK*/
      ty = initializer(p->type, 0, p);
      if (isarray(p->type) && p->type->size == 0)
         p->type = ty;
      p->defined = 1;
      if (p->sclass == EXTERN)
         p->sclass = AUTO;
/* initializer - constexpr | { constexpr ( , constexpr )* [ , ] } */
            e->type, ty);
         needconst--;
   if ((isunion(ty) || isstruct(ty)) && ty->size == 0) {
         n = initstruct(ty->u.sym->u.s.flist->type->size, ty, lev + 1);
         n = initstruct(ty->u.sym->u.s.flist->type->size, ty, lev + 1);
               e->type, ty);
         n = ty->size;
         n = initstruct(ty->size, ty, lev + 1);
         n = initstruct(ty->u.sym->u.s.flist->type->size, ty, lev + 1);
      aty = unqual(ty->type);
         if (ty->size > 0 && ty->size == tsym->type->size - 1)
            tsym->type = array(chartype, ty->size, STRUCT_ALIGN);
         n = tsym->type->size;
            defstring(tsym->type->size, tsym->u.c.v.p);
      } else if (lev > 0 && ty->size > 0)
         n = initchar(ty->size, aty);
      } else if (lev > 0 && ty->size > 0)
         n = initarray(ty->size, aty, lev + 1);
         n = initarray(aty->size, aty, lev + 1);
   if (ty->size) {
      if (n > ty->size)
      else if (n < ty->size)
         genspace(ty->size - n, current);
   } else if (isarray(ty) && ty->type->size > 0)
      ty = array(ty->type, n/ty->type->size, 0);
      ty->size = n;
/* initstruct - initialize a struct ty of <= len bytes; if len == 0, go to } */
   Field p = ty->u.sym->u.s.flist;
      if (p->offset > n) {
         genspace(p->offset - n, current);
         n += p->offset - n;
      if (p->to) {
         while (q->link && q->link->offset == p->offset)
            q = q->link;
         n += initfields(p, q->link);
         initializer(p->type, lev, 0);
         n += p->type->size;
      if (p->link) {
         p = p->link;
         a = p->type->align;
         a = ty->align;
         genspace(a - n%a, current);
/* initvalue - evaluate a constant expression for a value of integer type ty */
         e->type,  ty);
   needconst--;
   if (generic(e->op) != CNST) {
/* structexp - in-line structure expression '{' expr ( , expr )* [ , ] '}' */
/* swtoseg - switch to segment seg, if necessary */
