summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-05-20 17:14:38 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-05-20 17:15:20 +0100
commit9be179d740c9b639b309a376c4cb8265f2f1c7b9 (patch)
treea647d5169d315bc9eebee74048eccc3fc2a4fafc
parent9ecc3ba38d0b61dcefe9e2e32fc59f8835679df0 (diff)
eolian: add warnings for class/complex types with pointers (with env var)
-rw-r--r--src/lib/eolian/eo_parser.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index c9456963d5..0d5d18da96 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)
836parse_ptr: 836parse_ptr:
837 /* check: complex/class type must always be behind a pointer */ 837 /* check: complex/class type must always be behind a pointer */
838 if (!noptr && ((def->type == EOLIAN_TYPE_CLASS) || (def->type == EOLIAN_TYPE_COMPLEX))) 838 if (!noptr && ((def->type == EOLIAN_TYPE_CLASS) || (def->type == EOLIAN_TYPE_COMPLEX)))
839 check(ls, '*'); 839 {
840 if (getenv("EOLIAN_CLASS_NO_PTR"))
841 {
842 fprintf(stderr, "eolian:%s:%d:%d: pointer around complex/class type '%s'\n",
843 def->base.file, line, col, def->full_name);
844 if (ls->t.token != '*')
845 {
846 Eolian_Type *pdef;
847 pop_type(ls);
848 pdef = push_type(ls);
849 FILL_BASE(pdef->base, ls, ls->line_number, ls->column);
850 pdef->base_type = def;
851 pdef->type = EOLIAN_TYPE_POINTER;
852 def = pdef;
853 }
854 }
855 else check(ls, '*');
856 }
840 while (ls->t.token == '*') 857 while (ls->t.token == '*')
841 { 858 {
842 Eolian_Type *pdef; 859 Eolian_Type *pdef;