From: Jean-Philippe Andre Date: Tue, 31 Oct 2017 04:58:31 +0000 (+0900) Subject: eolian: Skip @beta APIs for duplicate warnings X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~1963 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1adb93b3e5ebee9ebc2c9d9a867d70099f27bbad;p=platform%2Fupstream%2Fefl.git eolian: Skip @beta APIs for duplicate warnings No warnings: export EOLIAN_WARN_FUNC_DUPLICATES=0 No beta warnings: export EOLIAN_WARN_FUNC_DUPLICATES=1 All warnings including beta: export EOLIAN_WARN_FUNC_DUPLICATES=2 EOLIAN_WARN_FUNC_DUPLICATES is not an API and may change in the future as we improve the tool :) --- diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index 28ffd5f..ed005ed 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -290,14 +290,22 @@ _validate_function(Eolian_Function *func, Eina_Hash *nhash) Eolian_Function_Parameter *param; char buf[512]; + static int _duplicates_warn = -1; + if (EINA_UNLIKELY(_duplicates_warn < 0)) + { + const char *s = getenv("EOLIAN_WARN_FUNC_DUPLICATES"); + if (!s) _duplicates_warn = 0; + else _duplicates_warn = atoi(s); + } + const Eolian_Function *ofunc = eina_hash_find(nhash, func->name); - if (ofunc) + if (EINA_UNLIKELY(ofunc && (_duplicates_warn > 0))) { snprintf(buf, sizeof(buf), - "function '%s' redefined (originally at %s:%d:%d)", - func->name, ofunc->base.file, + "%sfunction '%s' redefined (originally at %s:%d:%d)", + func->is_beta ? "beta " : "", func->name, ofunc->base.file, ofunc->base.line, ofunc->base.column); - if (getenv("EOLIAN_WARN_FUNC_DUPLICATES")) + if (!func->is_beta || (_duplicates_warn > 1)) _obj_error(&func->base, buf); }