Skip to content

gmsh 4.13.0 build fails on 32 bit arches with gcc 14

Build fails on Mageia Cauldron 32 bit arches (armv7hl and i686) with gcc 14:

/home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/tetMesh/src/hxt_tetRefine.c: In function 'balanceRefineWork':
/home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/tetMesh/src/hxt_tetRefine.c:346:32: error: passing argument 1 of 'scanbsearch' from incompatible pointer type [-Wincompatible-pointer-types]
  346 |     size_t* pfnd = scanbsearch(scan, scanToFind, mesh->tetrahedra.num);
      |                                ^~~~
      |                                |
      |                                size_t * {aka unsigned int *}
/home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/tetMesh/src/hxt_tetRefine.c:262:40: note: expected 'uint64_t *' {aka 'long long unsigned int *'} but argument is of type 'size_t *' {aka 'unsigned int *'}
  262 | static uint64_t* scanbsearch(uint64_t* array, uint64_t key, size_t num)
      |                              ~~~~~~~~~~^~~~~
/home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/tetMesh/src/hxt_tetRefine.c:346:20: error: initialization of 'size_t *' {aka 'unsigned int *'} from incompatible pointer type 'uint64_t *' {aka 'long long unsigned int *'} [-Wincompatible-pointer-types]
  346 |     size_t* pfnd = scanbsearch(scan, scanToFind, mesh->tetrahedra.num);
      |                    ^~~~~~~~~~~
In file included from /home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/core/include/hxt_mesh.h:8,
                 from /home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/tetMesh/include/hxt_tetNodalSize.h:12,
                 from /home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/tetMesh/include/hxt_tetDelaunay.h:16,
                 from /home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/tetMesh/src/hxt_tetRefine.c:9:
/home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/tetMesh/src/hxt_tetRefine.c: In function 'hxtRefineTetrahedra':
/home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/tetMesh/src/hxt_tetRefine.c:376:49: error: passing argument 3 of 'balanceRefineWork' from incompatible pointer type [-Wincompatible-pointer-types]
  376 |     HXT_CHECK( balanceRefineWork(mesh, startPt, startTet, maxThreads) );
      |                                                 ^~~~~~~~
      |                                                 |
      |                                                 uint64_t * {aka long long unsigned int *}
/home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/core/include/hxt_message.h:83:23: note: in definition of macro 'HXT_CHECK_MSG'
   83 |     HXTStatus _tmp_ = status;                   \
      |                       ^~~~~~
/home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/tetMesh/src/hxt_tetRefine.c:376:5: note: in expansion of macro 'HXT_CHECK'
  376 |     HXT_CHECK( balanceRefineWork(mesh, startPt, startTet, maxThreads) );
      |     ^~~~~~~~~
/home/iurt/rpmbuild/BUILD/gmsh-4.13.0-source/contrib/hxt/tetMesh/src/hxt_tetRefine.c:300:78: note: expected 'size_t *' {aka 'unsigned int *'} but argument is of type 'uint64_t *' {aka 'long long unsigned int *'}
  300 | static HXTStatus balanceRefineWork(HXTMesh* mesh, uint32_t* startPt, size_t* startTet, int maxThreads)
      |                                                                      ~~~~~~~~^~~~~~~~

I guess some size_t should be replaced with uint64_t in code.