Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with non-constant-expression cannot be narrowed from type 'int' to 'char' #29

Closed
mohamadhayek opened this issue Jul 31, 2019 · 4 comments
Assignees

Comments

@mohamadhayek
Copy link

Hello
I am trying to deploy irods python rule engine for iRODS 4.2.5.
when I send make package command I get the following error:

/home/ubuntu/irods_rule_engine_plugin_python/irods_types.cpp:572:30: note: in instantiation of function template specialization 'make_init_function<rodsEnv, char [64], char [64], int, char [1088], char [1088], char [64], char [64], char
[64], int, char [256], char [64], char [256], char [256], int, int, int, char [128], char [64], char [64], char [1088], char [1088], char [1088], char [1088], char [1088], char [1088], char [1088], int, int, char [128], int, int,
int, char [1088]>' requested here
.def("init", make_init_function(
^
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: note: insert an explicit cast to silence this issue
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static_cast( )
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: note: insert an explicit cast to silence this issue
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static_cast( )
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: note: insert an explicit cast to silence this issue
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static_cast( )
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: note: insert an explicit cast to silence this issue
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static_cast( )
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: note: insert an explicit cast to silence this issue
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static_cast( )
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: note: insert an explicit cast to silence this issue
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static_cast( )
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: note: insert an explicit cast to silence this issue
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static_cast( )
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: note: insert an explicit cast to silence this issue
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static_cast( )
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/irods_rule_engine_plugin_python/init_struct.hpp:60:20: note: insert an explicit cast to silence this issue
new T{ populate_helper(args, index, iter, index_into_array)... }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static_cast( )
4 warnings and 9 errors generated.
CMakeFiles/irods_rule_engine_plugin-python.dir/build.make:86: recipe for target 'CMakeFiles/irods_rule_engine_plugin-python.dir/irods_types.cpp.o' failed
make[2]: *** [CMakeFiles/irods_rule_engine_plugin-python.dir/irods_types.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/irods_rule_engine_plugin-python.dir/all' failed
make[1]: *** [CMakeFiles/irods_rule_engine_plugin-python.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

Best regards
Mohamad

@trel
Copy link
Member

trel commented Jul 31, 2019

Hi Mohamad - can you share the full path and version information for your cmake and clang?

Did you build irods/externals yourself?
If not, then why build the python rule engine plugin directly?

@trel
Copy link
Member

trel commented Jan 24, 2020

@mohamadhayek Any news on this?

@trel
Copy link
Member

trel commented Mar 11, 2020

closing

@trel trel closed this as completed Mar 11, 2020
@trel trel self-assigned this May 28, 2023
@alanking
Copy link
Contributor

Just making a note here that this is likely due to a missing member for some struct (see #168). I saw a similar failure that was resolved by adding a missing struct member.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants