* src/SDCCsymt.h,
[fw/sdcc] / src / SDCCval.c
index 6b18f5ea2815b08c7c1d0b3692e0989e3a1d8baf..69aab095c2031230256e3436672010820f19a5aa 100644 (file)
@@ -1560,7 +1560,13 @@ valCastLiteral (sym_link * dtype, double fval)
     return NULL;
 
   val = newValue ();
-  val->etype = getSpec (val->type = copyLinkChain (dtype));
+  if (dtype)
+    val->etype = getSpec (val->type = copyLinkChain (dtype));
+  else
+    {
+      val->etype = val->type = newLink (SPECIFIER);
+      SPEC_NOUN (val->etype) = V_VOID;
+    }
   SPEC_SCLS (val->etype) = S_LITERAL;
 
   /* if it is not a specifier then we can assume that */