Bug when compiling JModelica: ‘node.inner_id’ may be used uninitialized

3 posts / 0 new
Last post
Mathadon
Offline
Joined: 2014-01-03
Bug when compiling JModelica: ‘node.inner_id’ may be used uninitialized

When installing JModelica 9185 on a computing cluster (not sure if that is relevant) I get following error:


path/JModelica.org/RuntimeLibrary/src/jmi/jmi.c: In function ‘jmi_ode_initialize’:
path/JModelica.org/RuntimeLibrary/src/jmi/jmi.c:465: error: ‘node.inner_id’ may be used uninitialized in this function
path/JModelica.org/RuntimeLibrary/src/jmi/jmi.c: In function ‘jmi_ode_derivatives’:
path/JModelica.org/RuntimeLibrary/src/jmi/jmi.c:429: error: ‘node.inner_id’ may be used uninitialized in this function

I get the same error using gcc 4.8.2 and 4.9.2.

This is solved by adding the  -Wno-uninitialized compiler flag in RuntimeLibrary/src/jmi/CMakeLists.txt and ../build/RuntimeLibrary/build/src/modules/jmi_get_set_module/CMakeFiles/jmi_get_set_default.dir/flags.make. Looking at the code there seems to be an underlying problem in the code due to which this warning is correctly thrown - or the -Werror flag should be removed.

Mathadon
Offline
Joined: 2014-01-03
Following file needs to be

Following file needs to be changed to fix this properly: RuntimeLibrary/src/modules/jmi_get_set_module/CMakeLists.txt

Moreover I get: 
-- The C compiler identification is GNU 4.4.7

so this may be a compiler version issue.

Mathadon
Offline
Joined: 2014-01-03
This error was caused by a

This error was caused by a compiler inconsistency. For 'cc' GCC 4.4.7 was used, whereas for 'gcc' GCC 4.8.2 was used.

Login or register to post comments