uentry hdr;
if (!(context_inFunctionLike () || context_inMacroConstant ()
- || context_inMacroUnknown ()))
+ || context_inUnknownMacro ()))
{
llcontbug
(message
}
}
}
- else if (context_inMacroFunction () || context_inMacroUnknown ())
+ else if (context_inMacroFunction () || context_inUnknownMacro ())
{
ctype rettype = context_getRetType ();
uentry hdr;
if (!(context_inFunctionLike () || context_inMacroConstant ()
- || context_inMacroUnknown ()))
+ || context_inUnknownMacro ()))
{
llcontbug
(message ("exprNode_checkEmptyMacroBody: not in macro function or constant: %q",
ctype tr = ctype_getReturnType (context_currentFunctionType ());
ctype te = exprNode_getType (e);
+ /* evans 2001-08-21: added test to warn about void returns from void functions */
+ if (ctype_isVoid (tr))
+ {
+ (void) gentypeerror
+ (te, e, tr, exprNode_undefined,
+ message ("Return expression from function declared void: %s", exprNode_unparse (e)),
+ e->loc);
+ return;
+ }
+
if (!ctype_forceMatch (tr, te) && !exprNode_matchLiteral (tr, e))
{
(void) gentypeerror