-------------------------------------------------------------------------*/
#include "common.h"
-#include "newalloc.h"
int currLineno = 0;
set *astList = NULL;
ast *ex;
static int oldLineno = 0;
- Safe_calloc (1, ex, sizeof (ast));
+ ex = Safe_alloc ( sizeof (ast));
ex->type = type;
ex->lineno = (noLineno ? oldLineno : yylineno);
ast *ex;
static int oldLineno = 0;
- ex = Safe_calloc (1, sizeof (ast));
+ ex = Safe_alloc ( sizeof (ast));
ex->type = type;
ex->lineno = (noLineno ? oldLineno : yylineno);
break;
case INLINEASM:
- dest->values.inlineasm = Safe_calloc (1, strlen (src->values.inlineasm) + 1);
+ dest->values.inlineasm = Safe_alloc (strlen (src->values.inlineasm) + 1);
strcpy (dest->values.inlineasm, src->values.inlineasm);
break;
if (!src)
return NULL;
- dest = Safe_calloc (1, sizeof (ast));
+ dest = Safe_alloc ( sizeof (ast));
dest->type = src->type;
dest->lineno = src->lineno;
/* if defined parameters ended but actual parameters */
/* exist and this is not defined as a variable arg */
- /* also check if statckAuto option is specified */
- if ((!defParm) && actParm && (!func->hasVargs) &&
- !options.stackAuto && !IS_RENT (fetype))
+ /* also check if statckAuto option is specified */ // jwk: WHY?
+ if ((!defParm) && actParm && (!func->hasVargs)
+ /* && !options.stackAuto && !IS_RENT (fetype) */)
{
werror (E_TOO_MANY_PARMS);
return 1;
fprintf (stderr, "assigned to type --> '");
printTypeChain (defParm->type, stderr);
fprintf (stderr, "'\n");
+ return 1;
}
/* if the parameter is castable then add the cast */
{
sym_link *ltc = (tree->right ? RTYPE (tree) : LTYPE (tree));
COPYTYPE (TTYPE (tree), TETYPE (tree), ltc);
- if (!tree->initMode) {
- if ((IS_SPEC(TETYPE(tree)) && IS_CONSTANT (TETYPE (tree))) ||
- (IS_PTR(TTYPE(tree)) && DCL_PTR_CONST(TTYPE(tree)))) {
+ if (!tree->initMode && IS_CONSTANT(TETYPE(tree)))
werror (E_CODE_WRITE, "++/--");
- }
- }
if (tree->right)
RLVAL (tree) = 1;
RRVAL (tree) = 1;
LLVAL (tree) = 1;
if (!tree->initMode ) {
- if ((IS_SPEC(LETYPE(tree)) && IS_CONSTANT (LETYPE (tree))) ||
- (IS_PTR(LTYPE(tree)) && DCL_PTR_CONST(LTYPE(tree)))) {
+ if ((IS_SPEC(LETYPE(tree)) && IS_CONSTANT (LETYPE (tree))))
werror (E_CODE_WRITE, " ");
- }
}
if (LRVAL (tree))
{