From: Daniel Kolesa Date: Fri, 20 May 2016 16:14:38 +0000 (+0100) Subject: eolian: add warnings for class/complex types with pointers (with env var) X-Git-Tag: upstream/1.20.0~6227 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9be179d740c9b639b309a376c4cb8265f2f1c7b9;p=platform%2Fupstream%2Fefl.git eolian: add warnings for class/complex types with pointers (with env var) --- diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index c945696..0d5d18d 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -836,7 +836,24 @@ parse_type_void_base(Eo_Lexer *ls, Eina_Bool noptr) parse_ptr: /* check: complex/class type must always be behind a pointer */ if (!noptr && ((def->type == EOLIAN_TYPE_CLASS) || (def->type == EOLIAN_TYPE_COMPLEX))) - check(ls, '*'); + { + if (getenv("EOLIAN_CLASS_NO_PTR")) + { + fprintf(stderr, "eolian:%s:%d:%d: pointer around complex/class type '%s'\n", + def->base.file, line, col, def->full_name); + if (ls->t.token != '*') + { + Eolian_Type *pdef; + pop_type(ls); + pdef = push_type(ls); + FILL_BASE(pdef->base, ls, ls->line_number, ls->column); + pdef->base_type = def; + pdef->type = EOLIAN_TYPE_POINTER; + def = pdef; + } + } + else check(ls, '*'); + } while (ls->t.token == '*') { Eolian_Type *pdef;