exprNode_unparse (e1), exprNode_unparse (e2)),
arr->loc);
}
+ else if (ctype_isNumAbstract (rt))
+ {
+ vnoptgenerror
+ (FLG_NUMABSTRACTINDEX,
+ message ("Array fetch using numabstract type, %t: %s[%s]",
+ ind->typ,
+ exprNode_unparse (e1), exprNode_unparse (e2)),
+ arr->loc);
+ }
else
{
voptgenerror
expecttype = ctype_makeConj (ctype_int,
ctype_makeConj (ctype_char,
ctype_uchar));
- /*@i231@*/
/* evans 2001-10-05 - changed to reflect correct ISO spec:
int converted to char */
- /* expecttype = ctype_makeConj (ctype_char, ctype_uchar); */
/*@switchbreak@*/ break;
case 's': /* string */
codetext, expecttype,
a->typ, exprNode_unparse (a)),
a->loc))
- {
+ {
if (fileloc_isDefined (formatloc)
&& context_getFlag (FLG_SHOWCOL))
{
uentry_unparse (le)));
params = ctype_argsFunction (ct);
- return; /*@32 ! remove this? */
+ return; /* No checking for non-function */
}
/*
if (sRef_isResult (sRef_getRootBase (sel)))
{
- ; /*@i423 what do we do about results */
+ ; /* what do we do about results? */
}
else
{
ret->edata = exprData_makeCast (tok, e, q);
ret->sref = sRef_copy (e->sref);
-
- DPRINTF (("Cast 2: -> %s", sRef_unparseFull (ret->sref)));
+
+ DPRINTF (("Cast: -> %s", sRef_unparseFull (ret->sref)));
if (!sRef_isConst (e->sref))
{
*/
if (!ctype_isUA (targ) ||
- (!usymId_equal (ctype_typeId (targ),
- usymtab_getTypeId (cstring_makeLiteralTemp ("va_list")))))
+ (!typeId_equal (ctype_typeId (targ),
+ usymtab_getTypeId (cstring_makeLiteralTemp ("va_list")))))
{
voptgenerror
(FLG_TYPE,
exprNode exprNode_createTok (/*@only@*/ lltok t)
{
- exprNode ret; /*@i23 if on same line, bad things happen...!@*/
- ret = exprNode_create (ctype_unknown);
+ exprNode ret = exprNode_create (ctype_unknown);
ret->kind = XPR_TOK;
ret->edata = exprData_makeTok (t);
return ret;
exprNode_loc (pred));
}
- /*! exprNode_checkPred (cstring_makeLiteralTemp ("if"), pred); */ /*@i523@*/
exprNode_checkUse (pred, pred->sref, pred->loc);
if (!exprNode_isError (tclause))
exprNode_loc (pred));
}
- /*@i3423 exprNode_checkPred (cstring_makeLiteralTemp ("if"), pred);*/
exprNode_checkUse (ret, pred->sref, pred->loc);
-
exprNode_mergeCondUSs (ret, tclause, eclause);
}
{
uentry ue = usymtab_lookup (idDecl_observeId (t));
ret = exprNode_createId (ue);
-
- /*@i723 don't do this...but why? */
-# if 0
- ct = ctype_realishType (ret->typ);
-
- DPRINTF (("Type: %s", ctype_unparse (ret->typ)));
-
- if (ctype_isUnknown (ct))
- {
- if (uentry_isAnyTag (ue))
- {
- voptgenerror
- (FLG_IMPTYPE,
- message ("%s used but not previously declared: %s",
- uentry_ekindName (ue),
- idDecl_getName (t)),
- g_currentloc);
-
- }
- else
- {
- voptgenerror
- (FLG_IMPTYPE,
- message ("Variable has unknown (implicitly int) type: %s",
- idDecl_getName (t)),
- g_currentloc);
- }
-
- ct = ctype_int;
- }
-# endif
}
else
{
DPRINTF (("Unrecognized: %s", idDecl_unparse (t)));
ue = uentry_makeUnrecognized (idDecl_observeId (t), fileloc_copy (g_currentloc));
- /*!! fileloc_copy (g_currentloc)); */
- /*@i32!!! should get error without this */
-
ret = exprNode_fromIdentifierAux (ue);
/*
}
else if (multiVal_isChar (m))
{
- char val = multiVal_forceChar (m);
+ /*signed? */ char val = multiVal_forceChar (m);
if (ctype_isChar (expected))
{
- if (ctype_isUnsigned (expected) && ((int)val) < 0)
+ if (ctype_isUnsigned (expected) && ((int) val) < 0)
{
return FALSE;
}
ctype ct = sRef_getType (sr);
if (ctype_isAbstract (t2)
+ && !ctype_isNumAbstract (t2)
&& !(uentry_isMutableDatatype (usymtab_getTypeEntry (ctype_typeId (t2)))))
{
/* it is immutable, okay to reference */
} end_exprNodeList_elements;
}
-long exprNode_getLongValue (exprNode e) {
+long exprNode_getLongValue (exprNode e)
+{
long value;
-
- if (exprNode_hasValue (e)
- && multiVal_isInt (exprNode_getValue (e)))
+
+ if (exprNode_hasValue (e) && multiVal_isInt (exprNode_getValue (e)))
{
value = multiVal_forceInt (exprNode_getValue (e));
}
else
{
- /*@!! BADBRANCH;*/
- value = 0;
+ value = 0; /* Unknown value */
}
return value;
}
-/*@observer@*/ fileloc exprNode_getfileloc (exprNode p_e)
-{
- if (exprNode_isDefined (p_e) )
- return ( p_e->loc );
- else
- return fileloc_undefined;
-}
-
/*@only@*/ fileloc exprNode_getNextSequencePoint (exprNode e)
{
/*