From 3215b8241b93e48d217ffac784d64624dcd26eb3 Mon Sep 17 00:00:00 2001 From: johanknol Date: Fri, 7 Sep 2001 14:35:08 +0000 Subject: [PATCH] fixed bug #456235 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1240 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 2 ++ src/SDCCicode.c | 4 ++++ support/Util/SDCCerr.c | 4 +++- support/Util/SDCCerr.h | 3 ++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4be5f204..7ffaac40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2001-09-07 + * src/SDCCicode.c (newiCodeCondition): fixed bug #456235 (1.77) + * src/SDCCglue.c (emitRegularMap): only delete a symbol when it is a symbol 2001-09-06 diff --git a/src/SDCCicode.c b/src/SDCCicode.c index 4dab87ed..c5bc3f15 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -474,6 +474,10 @@ newiCodeCondition (operand * condition, { iCode *ic; + if (IS_VOID(OP_SYMBOL(condition)->type)) { + werror(E_VOID_VALUE_USED); + } + ic = newiCode (IFX, NULL, NULL); IC_COND (ic) = condition; IC_TRUE (ic) = trueLabel; diff --git a/support/Util/SDCCerr.c b/support/Util/SDCCerr.c index d3f54cb6..fd5d6a20 100644 --- a/support/Util/SDCCerr.c +++ b/support/Util/SDCCerr.c @@ -358,7 +358,9 @@ struct { E_CANNOT_USE_GENERIC_POINTER, ERROR_LEVEL_ERROR, "cannot use generic pointer %s to initialize %s" }, { W_EXCESS_SHORT_OPTIONS, ERROR_LEVEL_WARNING, - "Only one short option can be specified at a time. Rest of %s ignored." } + "Only one short option can be specified at a time. Rest of %s ignored." }, +{ E_VOID_VALUE_USED, ERROR_LEVEL_ERROR, + "void value not ignored as it ought to be" }, }; /* diff --git a/support/Util/SDCCerr.h b/support/Util/SDCCerr.h index 24d28264..8bcd4c48 100644 --- a/support/Util/SDCCerr.h +++ b/support/Util/SDCCerr.h @@ -167,7 +167,8 @@ SDCCERR - SDCC Standard error handler #define W_STRAY_BACKSLASH 149 #define W_NEWLINE_IN_STRING 150 #define E_CANNOT_USE_GENERIC_POINTER 151 -#define W_EXCESS_SHORT_OPTIONS 152 +#define W_EXCESS_SHORT_OPTIONS 152 +#define E_VOID_VALUE_USED 153 /** Describes the maximum error level that will be logged. Any level * includes all of the levels listed after it. -- 2.47.2