From: johanknol Date: Thu, 3 Apr 2003 07:35:35 +0000 (+0000) Subject: missing return values is a warning now X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=814818d257f2d990db5aa82da055c399b089b6bd;p=fw%2Fsdcc missing return values is a warning now git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2467 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCast.c b/src/SDCCast.c index fae7603b..91a4f81e 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -3330,7 +3330,7 @@ decorateType (ast * tree) if (!IS_VOID (currFunc->type->next) && tree->right == NULL) { - werror (E_VOID_FUNC, currFunc->name); + werror (W_VOID_FUNC, currFunc->name); goto errorTreeReturn; } diff --git a/src/SDCCopt.c b/src/SDCCopt.c index 1d390a69..374c34d2 100644 --- a/src/SDCCopt.c +++ b/src/SDCCopt.c @@ -895,7 +895,7 @@ eBBlockFromiCode (iCode * ic) bp; bp=setNextItem(ebbs[saveCount-1]->predList)) { if (bp->ech->op != RETURN) { - werror (E_VOID_FUNC, currFunc->name); + werror (W_VOID_FUNC, currFunc->name); } } } diff --git a/support/Util/SDCCerr.c b/support/Util/SDCCerr.c index 6698c0a4..1bc00c11 100644 --- a/support/Util/SDCCerr.c +++ b/support/Util/SDCCerr.c @@ -169,7 +169,7 @@ struct "Label undefined '%s'" }, { E_FUNC_VOID, ERROR_LEVEL_ERROR, "void function returning value" }, -{ E_VOID_FUNC, ERROR_LEVEL_ERROR, +{ W_VOID_FUNC, ERROR_LEVEL_WARNING, "function '%s' must return value" }, { W_RETURN_MISMATCH, ERROR_LEVEL_WARNING, "function return value mismatch" }, diff --git a/support/Util/SDCCerr.h b/support/Util/SDCCerr.h index ce20b853..73987cb0 100644 --- a/support/Util/SDCCerr.h +++ b/support/Util/SDCCerr.h @@ -74,7 +74,7 @@ SDCCERR - SDCC Standard error handler #define E_DUPLICATE_LABEL 56 /* duplicate label name */ #define E_LABEL_UNDEF 57 /* undefined label used */ #define E_FUNC_VOID 58 /* void func ret value */ -#define E_VOID_FUNC 59 /* func must return value */ +#define W_VOID_FUNC 59 /* func must return value */ #define W_RETURN_MISMATCH 60 /* return value mismatch */ #define E_CASE_CONTEXT 61 /* case stmnt without switch */ #define E_CASE_CONSTANT 62 /* case expression ! const*/