code-saturne / code_saturne

code_saturne public mirror
https://www.code-saturne.org
GNU General Public License v2.0
215 stars 80 forks source link

compilation errors: incompatible pointer to integer conversion #120

Closed thierry-FreeBSD closed 11 months ago

thierry-FreeBSD commented 11 months ago

When launching make check, compilation fails with these errors (clang 16):

cc -DHAVE_CONFIG_H -I/usr/ports/science/code_saturne/work/code_saturne-8.0.0/libple -I../libple/src -I/usr/ports/science/code_saturne/work/code_saturne-8.0.0 -I../src/user -I../src/cogz -I../src/darc -I../src/cfbl -I../src/comb -I../src/ctwr -I../src/fvm -I../src/apps -I../src/elec -I../src/rayt -I../src/bft -I../src/user_examples -I../src/meg -I../src/pprt -I../src/lagr -I../src/base -I../src/mesh -I../src/alge -I../src/atmo -I../src/cdo -I../src/turb -I../src/gui -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -DMPICH_SKIP_MPICXX -I/usr/local/include/cblas -I/usr/local/include -I/usr/local/include/libxml2 -DLIBICONV_PLUG -isystem /usr/local/include -DNDEBUG -funsigned-char -Wall -Wshadow -Wpointer-arith -Wmissing-prototypes -Wuninitialized -Wunused -O2 -pipe -D__XSI_VISIBLE -Wno-error=incompatible-function-pointer-types -Wno-incompatible-pointer-types -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fopenmp=libomp -O2 -c ../tests/cs_matrix_test.c
../tests/cs_matrix_test.c:646:52: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'cs_lnum_t' (aka 'int') [-Wint-conversion]
        mav = cs_matrix_assembler_values_init(m_0, NULL, NULL);
                                                   ^~~~
/usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
#define NULL    ((void *)0)
                ^~~~~~~~~~~
../src/alge/cs_matrix.h:640:47: note: passing argument to parameter 'diag_block_size' here
                                cs_lnum_t     diag_block_size,
                                              ^
../tests/cs_matrix_test.c:646:58: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'cs_lnum_t' (aka 'int') [-Wint-conversion]
        mav = cs_matrix_assembler_values_init(m_0, NULL, NULL);
                                                         ^~~~
/usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
#define NULL    ((void *)0)
                ^~~~~~~~~~~
../src/alge/cs_matrix.h:641:47: note: passing argument to parameter 'extra_diag_block_size' here
                                cs_lnum_t     extra_diag_block_size);
                                              ^
../tests/cs_matrix_test.c:648:52: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'cs_lnum_t' (aka 'int') [-Wint-conversion]
        mav = cs_matrix_assembler_values_init(m_1, NULL, NULL);
                                                   ^~~~
/usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
#define NULL    ((void *)0)
                ^~~~~~~~~~~
../src/alge/cs_matrix.h:640:47: note: passing argument to parameter 'diag_block_size' here
                                cs_lnum_t     diag_block_size,
                                              ^
../tests/cs_matrix_test.c:648:58: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'cs_lnum_t' (aka 'int') [-Wint-conversion]
        mav = cs_matrix_assembler_values_init(m_1, NULL, NULL);
                                                         ^~~~
/usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
#define NULL    ((void *)0)
                ^~~~~~~~~~~
../src/alge/cs_matrix.h:641:47: note: passing argument to parameter 'extra_diag_block_size' here
                                cs_lnum_t     extra_diag_block_size);
                                              ^
4 errors generated.
YvanFournier commented 11 months ago

Hello,

Fixed in v8.0 branch in commit 7ea539b65 (already correct/up to date on master branch).