type_specifier_list
: type_specifier
- | type_specifier_list type_specifier { $$ = mergeSpec ($1,$2, "type_specifier_list"); }
+ //| type_specifier_list type_specifier { $$ = mergeSpec ($1,$2, "type_specifier_list"); }
+ | type_specifier_list type_specifier {
+ /* if the decl $2 is not a specifier */
+ /* find the spec and replace it */
+ if ( !IS_SPEC($2)) {
+ sym_link *lnk = $2 ;
+ while (lnk && !IS_SPEC(lnk->next))
+ lnk = lnk->next;
+ lnk->next = mergeSpec($1,lnk->next, "type_specifier_list");
+ $$ = $2 ;
+ }
+ else
+ $$ = mergeSpec($1,$2, "type_specifier_list");
+ }
;
parameter_identifier_list
processParms (ast * func,
value * defParm,
ast * actParm,
- int *parmNumber,
- bool rightmost)
+ int *parmNumber, // unused, although updated
+ bool rightmost) // double checked?
{
sym_link *fetype = func->etype;
if (defParm) {
if (getenv("DEBUG_SANITY")) {
- fprintf (stderr, "addSym: %s ", defParm->name);
+ fprintf (stderr, "processParms: %s ", defParm->name);
}
/* make sure the type is complete and sane */
checkTypeSanity(defParm->etype, defParm->name);
}
}
-
/* the parameter type must be at least castable */
if (compareType (defParm->type, actParm->ftype) == 0) {
werror (E_INCOMPAT_TYPES);
max = pow ((double)2.0, (double)bitsForType(ltype));
if (SPEC_LONG(val->type)) {
- v=SPEC_CVAL(val->type).v_long;
+ if (SPEC_USIGN(val->type)) {
+ v=SPEC_CVAL(val->type).v_ulong;
+ } else {
+ v=SPEC_CVAL(val->type).v_long;
+ }
} else {
- v=SPEC_CVAL(val->type).v_int;
+ if (SPEC_USIGN(val->type)) {
+ v=SPEC_CVAL(val->type).v_uint;
+ } else {
+ v=SPEC_CVAL(val->type).v_int;
+ }
}
void
aggregateArgToPointer (value * val)
{
+ int wasArray=IS_ARRAY(val->type);
+
if (IS_AGGREGATE (val->type))
{
/* if this is a structure */
default:
DCL_TYPE (val->type) = GPOINTER;
}
+
+ if (wasArray) {
+ /* there is NO way to specify the storage of the pointer
+ associated with an array, so we make it the default */
+ SPEC_SCLS(val->etype) = S_FIXED;
+ }
/* is there is a symbol associated then */
/* change the type of the symbol as well */
werror (E_PREV_DEF_CONFLICT, csym->name, "_naked");
}
- /* compare expected agrs with actual args */
+ /* compare expected args with actual args */
exargs = csym->args;
acargs = sym->args;