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

error: invalid conversion from 'int*' to 'mat_uint32_t*' #421

Closed
sagitter opened this issue Sep 20, 2020 · 3 comments · Fixed by #422
Closed

error: invalid conversion from 'int*' to 'mat_uint32_t*' #421

sagitter opened this issue Sep 20, 2020 · 3 comments · Fixed by #422

Comments

@sagitter
Copy link

Hi all.

openmeeg-2.4.2 is not compiling against the new matio-1.5.18:

[  9%] Building CXX object OpenMEEGMaths/CMakeFiles/OpenMEEGMaths.dir/src/MatlabIO.C.o
cd /builddir/build/BUILD/openmeeg-2.4.2/build/OpenMEEGMaths && /usr/bin/g++ -DHAVE_BLAS -DHAVE_LAPACK -DOpenMEEGMaths_EXPORTS -DUSE_LAPACK -I/builddir/build/BUILD/openmeeg-2.4.2/OpenMEEGMaths/include -I/usr/include/flexiblas -I/builddir/build/BUILD/openmeeg-2.4.2/OpenMEEGMaths/MATIO::MATIO -I/builddir/build/BUILD/openmeeg-2.4.2/build/OpenMEEGMaths -I/builddir/build/BUILD/openmeeg-2.4.2/build -I/builddir/build/BUILD/openmeeg-2.4.2/OpenMEEGMaths/OpenMEEGMaths/src -O2  -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -DNDEBUG -fPIC -std=gnu++11 -o CMakeFiles/OpenMEEGMaths.dir/src/MatlabIO.C.o -c /builddir/build/BUILD/openmeeg-2.4.2/OpenMEEGMaths/src/MatlabIO.C
In file included from /builddir/build/BUILD/openmeeg-2.4.2/OpenMEEGMaths/src/MatlabIO.C:40:
/builddir/build/BUILD/openmeeg-2.4.2/OpenMEEGMaths/include/MatlabIO.H: In member function 'void OpenMEEG::maths::MatlabIO::write_sparse(mat_t*, const OpenMEEG::LinOp&) const':
/builddir/build/BUILD/openmeeg-2.4.2/OpenMEEGMaths/include/MatlabIO.H:384:42: warning: narrowing conversion of '(int)sz' from 'int' to 'mat_uint32_t' {aka 'unsigned int'} [-Wnarrowing]
  384 |                 mat_sparse_t  sparse = { sz, ir, sz, jc, num, sz, t};
      |                                          ^~
/builddir/build/BUILD/openmeeg-2.4.2/OpenMEEGMaths/include/MatlabIO.H:384:46: error: invalid conversion from 'int*' to 'mat_uint32_t*' {aka 'unsigned int*'} [-fpermissive]
  384 |                 mat_sparse_t  sparse = { sz, ir, sz, jc, num, sz, t};
      |                                              ^~
      |                                              |
      |                                              int*
/builddir/build/BUILD/openmeeg-2.4.2/OpenMEEGMaths/include/MatlabIO.H:384:50: warning: narrowing conversion of '(int)sz' from 'int' to 'mat_uint32_t' {aka 'unsigned int'} [-Wnarrowing]
  384 |                 mat_sparse_t  sparse = { sz, ir, sz, jc, num, sz, t};
      |                                                  ^~
/builddir/build/BUILD/openmeeg-2.4.2/OpenMEEGMaths/include/MatlabIO.H:384:54: error: invalid conversion from 'int*' to 'mat_uint32_t*' {aka 'unsigned int*'} [-fpermissive]
  384 |                 mat_sparse_t  sparse = { sz, ir, sz, jc, num, sz, t};
      |                                                      ^~
      |                                                      |
      |                                                      int*
/builddir/build/BUILD/openmeeg-2.4.2/OpenMEEGMaths/include/MatlabIO.H:384:58: warning: narrowing conversion of '(int)num' from 'int' to 'mat_uint32_t' {aka 'unsigned int'} [-Wnarrowing]
  384 |                 mat_sparse_t  sparse = { sz, ir, sz, jc, num, sz, t};
      |                                                          ^~~
/builddir/build/BUILD/openmeeg-2.4.2/OpenMEEGMaths/include/MatlabIO.H:384:63: warning: narrowing conversion of '(int)sz' from 'int' to 'mat_uint32_t' {aka 'unsigned int'} [-Wnarrowing]
  384 |                 mat_sparse_t  sparse = { sz, ir, sz, jc, num, sz, t};
      |                                                               ^~
make[2]: *** [OpenMEEGMaths/CMakeFiles/OpenMEEGMaths.dir/build.make:176: OpenMEEGMaths/CMakeFiles/OpenMEEGMaths.dir/src/MatlabIO.C.o] Error 1
make[2]: Leaving directory '/builddir/build/BUILD/openmeeg-2.4.2/build'
make[1]: *** [CMakeFiles/Makefile2:380: OpenMEEGMaths/CMakeFiles/OpenMEEGMaths.dir/all] Error 2
make[1]: Leaving directory '/builddir/build/BUILD/openmeeg-2.4.2/build'
make: *** [Makefile:163: all] Error 2

Fedora 34 (devel branch)
GCC-10.2.1

@papadop
Copy link
Contributor

papadop commented Sep 28, 2020

Sorry for not replying to this earlier (quite busy and I did not saw it was related to a version bump in matio, so was puzzled by such a matio error). I have a path that will be committed soon and should appear on master very fast.

@papadop
Copy link
Contributor

papadop commented Sep 28, 2020

Should be solved with commit d1ea026 as soon as testers will tag it as green and that the merge request is processed.

@sagitter
Copy link
Author

Should be solved with commit d1ea026 as soon as testers will tag it as green and that the merge request is processed.

This patch fixes the issue for me.
Thanks.

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

Successfully merging a pull request may close this issue.

2 participants