Closed DLu closed 7 years ago
If you write an enum description with a single quote and use it in C++, you will get some weird errors.
dyn_param_error.zip
combo_enum = gen.enum([ gen.const("A", int_t, 0, "I can do it"), gen.const("B", int_t, 0, "I cant do it"), ], "x")
gen.const("B", int_t, 0, "I can't do it"),
In file included from /home/dlu/bnr_software/src/bnr_autonomy/bnr_navigation/dyn_param_error/src/x.cpp:1:0: /home/dlu/bnr_software/devel/include/dyn_param_error/DynParamConfig.h:387:475: warning: character constant too long for its type [enabled by default] Default.abstract_parameters.push_back(DynParamConfig::AbstractParamDescriptionConstPtr(new DynParamConfig::ParamDescription<int>("combination_method", "int", 0, "", "{'enum_description': 'x', 'enum': [{'srcline': 8, 'description': 'I can do it', 'srcfile': '/home/dlu/bnr_software/src/bnr_autonomy/bnr_navigation/dyn_param_error/cfg/DynParam.cfg', 'cconsttype': 'const int', 'value': 0, 'ctype': 'int', 'type': 'int', 'name': 'A'}, {'srcline': 9, 'description': "I can't do it", 'srcfile': '/home/dlu/bnr_software/src/bnr_autonomy/bnr_navigation/dyn_param_error/cfg/DynParam.cfg', 'cconsttype': 'const int', 'value': 0, 'ctype': 'int', 'type': 'int', 'name': 'B'}]}", &DynParamConfig::combination_method))); ^ /home/dlu/bnr_software/devel/include/dyn_param_error/DynParamConfig.h:387:494: warning: multi-character character constant [-Wmultichar] Default.abstract_parameters.push_back(DynParamConfig::AbstractParamDescriptionConstPtr(new DynParamConfig::ParamDescription<int>("combination_method", "int", 0, "", "{'enum_description': 'x', 'enum': [{'srcline': 8, 'description': 'I can do it', 'srcfile': '/home/dlu/bnr_software/src/bnr_autonomy/bnr_navigation/dyn_param_error/cfg/DynParam.cfg', 'cconsttype': 'const int', 'value': 0, 'ctype': 'int', 'type': 'int', 'name': 'A'}, {'srcline': 9, 'description': "I can't do it", 'srcfile': '/home/dlu/bnr_software/src/bnr_autonomy/bnr_navigation/dyn_param_error/cfg/DynParam.cfg', 'cconsttype': 'const int', 'value': 0, 'ctype': 'int', 'type': 'int', 'name': 'B'}]}", &DynParamConfig::combination_method))); ^ ...[and many more]...
Addressed in #74 and #76
If you write an enum description with a single quote and use it in C++, you will get some weird errors.
example package
dyn_param_error.zip
this works
This doesn't
Errors