geniCodePreDec): Fixed bug 904237 by generating a warning
* src/SDCCerr.h,
* src/SDCCerr.c: added warning W_SIZEOF_VOID
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3486
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2004-09-08 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * src/SDCCicode.c (geniCodePostInc, geniCodePreInc, geniCodePostDec,
+ geniCodePreDec): Fixed bug 904237 by generating a warning
+ * src/SDCCerr.h,
+ * src/SDCCerr.c: added warning W_SIZEOF_VOID
+
2004-09-09 Slade Rich <slade_rich AT users.sourceforge.net>
* src/pic/device.c : When no max ram set validate full memory range.
geniCodeAssign (rOp, rv, 0, 0);
size = (IS_PTR (rvtype) ? getSize (rvtype->next) : 1);
+ if (size == 0)
+ werror(W_SIZEOF_VOID);
if (IS_FLOAT (rvtype))
ic = newiCode ('+', rv, operandFromValue (constFloatVal ("1.0")));
else
return op;
}
-
size = (IS_PTR (roptype) ? getSize (roptype->next) : 1);
+ if (size == 0)
+ werror(W_SIZEOF_VOID);
if (IS_FLOAT (roptype))
ic = newiCode ('+', rop, operandFromValue (constFloatVal ("1.0")));
else
geniCodeAssign (rOp, rv, 0, 0);
size = (IS_PTR (rvtype) ? getSize (rvtype->next) : 1);
+ if (size == 0)
+ werror(W_SIZEOF_VOID);
if (IS_FLOAT (rvtype))
ic = newiCode ('-', rv, operandFromValue (constFloatVal ("1.0")));
else
return op;
}
-
size = (IS_PTR (roptype) ? getSize (roptype->next) : 1);
+ if (size == 0)
+ werror(W_SIZEOF_VOID);
if (IS_FLOAT (roptype))
ic = newiCode ('-', rop, operandFromValue (constFloatVal ("1.0")));
else
"sizeof applied to an incomplete type" },
{ E_PREVIOUS_DEF, ERROR_LEVEL_ERROR,
"previously defined here" },
+{ W_SIZEOF_VOID, ERROR_LEVEL_WARNING,
+ "size of void is zero" },
};
/*
#define W_DEPRECATED_PRAGMA 175 /* deprecated pragma */
#define E_SIZEOF_INCOMPLETE_TYPE 176 /* sizeof applied to an incomplete type */
#define E_PREVIOUS_DEF 177 /* previously defined here */
+#define W_SIZEOF_VOID 178 /* size of void is zero */
#define MAX_ERROR_WARNING 256 /* size of disable warnings array */