eolian: enable duplicate validation but only warn for now

Use the EOLIAN_WARN_FUNC_DUPLICATES environment variable to enable
those warnings.
This commit is contained in:
Daniel Kolesa 2017-10-25 13:03:20 +02:00
parent 61f4a5e033
commit c46f9bec2d
1 changed files with 6 additions and 1 deletions

View File

@ -297,7 +297,8 @@ _validate_function(Eolian_Function *func, Eina_Hash *nhash)
"function '%s' redefined (originally at %s:%d:%d)",
func->name, ofunc->base.file,
ofunc->base.line, ofunc->base.column);
return _obj_error(&func->base, buf);
if (getenv("EOLIAN_WARN_FUNC_DUPLICATES"))
_obj_error(&func->base, buf);
}
if (func->get_ret_type && !_validate_type(func->get_ret_type))
@ -333,6 +334,10 @@ _validate_function(Eolian_Function *func, Eina_Hash *nhash)
if (!_validate_doc(func->set_return_doc))
return EINA_FALSE;
/* just for now, when dups become errors there will be no need to check */
if (!ofunc)
eina_hash_add(nhash, func->name, func);
return _validate(&func->base);
}