/* the parameter type must be at least castable */
if (compareType (defParm->type, actParm->ftype) == 0) {
werror (E_INCOMPAT_TYPES);
- fprintf (stderr, "type --> '");
- printTypeChain (actParm->ftype, stderr);
- fprintf (stderr, "' ");
- fprintf (stderr, "assigned to type --> '");
- printTypeChain (defParm->type, stderr);
- fprintf (stderr, "'\n");
+ printFromToType (actParm->ftype, defParm->type);
return 1;
}
createIvalStruct (ast * sym, sym_link * type, initList * ilist)
{
ast *rast = NULL;
+ ast *lAst;
symbol *sflds;
initList *iloop;
for (; sflds; sflds = sflds->next, iloop = (iloop ? iloop->next : NULL))
{
- ast *lAst;
-
/* if we have come to end */
if (!iloop)
break;
if (IS_VOID (LTYPE (tree)))
{
werror (E_CAST_ZERO);
- fprintf (stderr, "type --> '");
- printTypeChain (RTYPE (tree), stderr);
- fprintf (stderr, "' ");
- fprintf (stderr, "assigned to type --> '");
- printTypeChain (LTYPE (tree), stderr);
- fprintf (stderr, "'\n");
+ printFromToType(RTYPE(tree), LTYPE(tree));
}
TETYPE (tree) = getSpec (TTYPE (tree) =
if (compareType (currFunc->type->next, RTYPE (tree)) == 0)
{
werror (W_RETURN_MISMATCH);
- fprintf (stderr, "from type '");
- printTypeChain (RTYPE(tree), stderr);
- fprintf (stderr, "' to type '");
- printTypeChain (currFunc->type->next, stderr);
- fprintf (stderr, "'\n");
+ printFromToType (RTYPE(tree), currFunc->type->next);
goto errorTreeReturn;
}
}
}
if (errors) {
- /* fprintf (stderr, "%s%s %d: ", op->operand.symOperand->name,
- implicit?"(implicit)":"", errors); */
- fprintf (stderr, "from type '");
- printTypeChain (optype, stderr);
- fprintf (stderr, "' to type '");
- printTypeChain (type, stderr);
- fprintf (stderr, "'\n");
+ printFromToType (optype, type);
}
/* if they are the same size create an assignment */
SPEC_OCLS (retype) = SPEC_OCLS (etype);
SPEC_VOLATILE (retype) |= SPEC_VOLATILE (etype);
+#if 1 // jwk
if (IS_PTR (element->type))
setOperandType (IC_RESULT (ic), aggrToPtr (operandType (IC_RESULT (ic)), TRUE));
+#endif
IC_RESULT (ic)->isaddr = (!IS_AGGREGATE (element->type));
argVals=FUNC_ARGS(func->type);
}
- if (parms->argSym ||
- (parms->type!=EX_OP && parms->type!=EX_OPERAND)) {
- fprintf (stderr, "What the fuck??\n");
- }
-
/* if this is a param node then do the left & right */
if (parms->type == EX_OP && parms->opval.op == PARAM)
{
value *aggregateToPointer (value *val);
+void printFromToType(sym_link *from, sym_link *to) {
+ fprintf (stderr, "from type '");
+ printTypeChain (from, stderr);
+ fprintf (stderr, "'\nto type '");
+ printTypeChain (to, stderr);
+ fprintf (stderr, "'\n");
+}
+
/* noun strings */
char *nounName(sym_link *sl) {
switch (SPEC_NOUN(sl))
exit (1);
}
- if (getenv("DEBUG_mergeSpec")) {
- fprintf (stderr, "mergeSpec: \"%s\"\n", name);
- }
-
if (SPEC_NOUN(src)) {
if (!SPEC_NOUN(dest)) {
SPEC_NOUN(dest)=SPEC_NOUN(src);
if (getenv("DEBUG_SANITY")) {
fprintf (stderr, "checkSClass: %s \n", sym->name);
}
- if (strcmp(sym->name, "_testsGlobal")==0) {
- printf ("oach\n");
- }
/* type is literal can happen foe enums change
to auto */
case S_FIXED:
if (SPEC_OCLS(val->etype)) {
DCL_TYPE(val->type)=PTR_TYPE(SPEC_OCLS(val->etype));
+ break;
}
- break;
if (TARGET_IS_DS390)
{
if (compareType (csym->type, sym->type) <= 0)
{
werror (E_PREV_DEF_CONFLICT, csym->name, "type");
- werror (W_CONTINUE, "previous definition type ");
- printTypeChain (csym->type, stderr);
- fprintf (stderr, "\n");
- werror (W_CONTINUE, "current definition type ");
- printTypeChain (sym->type, stderr);
- fprintf (stderr, "\n");
+ printFromToType(csym->type, sym->type);
return 0;
}
if (compareType (exargs->type, checkValue->type) <= 0)
{
werror (E_ARG_TYPE, argCnt);
+ printFromToType(exargs->type, checkValue->type);
return 0;
}
}
void *findSymWithBlock (bucket **, struct symbol *, int);
void changePointer (symbol * sym);
void checkTypeSanity(sym_link *etype, char *name);
-/* noun strings */
-extern char *nounName(sym_link *);
+
+extern char *nounName(sym_link *); /* noun strings */
+extern void printFromToType (sym_link *, sym_link *);
#endif