fix sizeof(string) to return the size of the string instead of the size of
a pointer
EMMESLIB = $(EMHOME)/modules/lib/libem_mes.a
EMMESOLIB = $(EMHOME)/modules/lib/libem_mesO.a
EMMESCELIB = $(EMHOME)/modules/lib/libem_mesCE.a
-MACH = vax4
+MACH = sun3
EMCELIB = $(EMHOME)/lib/$(MACH)/ce.a \
$(EMHOME)/lib/$(MACH)/back.a \
$(EMHOME)/modules/lib/libobject.a $(EMHOME)/lib/em_data.a
)
warning("sizeof formal array %s is sizeof pointer!",
(*expp)->VL_IDF->id_text);
- expr = intexpr(size_of_type((*expp)->ex_type, "object"), INT);
+ expr = intexpr((*expp)->ex_type == string_type ?
+ (arith)((*expp)->SG_LEN) :
+ size_of_type((*expp)->ex_type, "object"),
+ INT);
expr->ex_flags |= EX_SIZEOF;
free_expression(*expp);
*expp = expr;
ASSERT(is_cp_cst(ex));
if (tp->tp_unsigned)
C_con_ucon(long2str((long)ex->VL_VALUE, -10), tp->tp_size);
+ else if (tp->tp_size == word_size)
+ C_con_cst(ex->VL_VALUE);
else
C_con_icon(long2str((long)ex->VL_VALUE, 10), tp->tp_size);
}