Skip to content

Backport the Trapezoid theta,phi fix and fix a few CMake and compiler warnings

Guilherme Lima requested to merge lima/fix-warnings into v1-patches

This merge request applies to the v1-patches branch:

  • Evgueni's fix to the trapezoid theta,phi (see MR !1031 (merged))
  • a fix to CMake policy CMP0135, described in MR !1045 (merged)
  • compilation warnings from gcc 12.3.0
-- Build files have been written to: /work1/celeritas/lima/work/local/gcc-12.3.0/vecgeom/build-1.2.8
[299/416] Building CUDA object CMakeFiles/vecgeomcuda_obj.dir/cuda_src/UnplacedPolyhedron.cu.o
In member function ‘void vecgeom::cuda::Array<Type>::Allocate(unsigned int) [with Type = vecgeom::cuda::ZSegment]’,
    inlined from ‘vecgeom::cuda::PolyhedronStruct<T>::PolyhedronStruct(vecgeom::cuda::Precision, vecgeom::cuda::Precision, int, int, const vecgeom::cuda::Precision*, const vecgeom::cuda::Precision*) [with T = double]’ at /work1/celeritas/lima/work/local/src/vecgeom/repo/VecGeom/volumes/PolyhedronStruct.h:229:22:
/work1/celeritas/lima/work/local/src/vecgeom/repo/VecGeom/base/Array.h:126:39: warning: argument 1 value ‘18446744073709550152’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  126 |   fData = static_cast<Type *>(malloc(fSize * sizeof(Type))); // new Type[fSize];
      |                                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/stdlib.h: In constructor ‘vecgeom::cuda::PolyhedronStruct<T>::PolyhedronStruct(vecgeom::cuda::Precision, vecgeom::cuda::Precision, int, int, const vecgeom::cuda::Precision*, const vecgeom::cuda::Precision*) [with T = double]’:
/usr/include/stdlib.h:539:14: note: in a call to allocation function ‘void* malloc(size_t)’ declared here
  539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
      |              ^~~~~~

PS: It makes sense to avoid squashing the commits.

Merge request reports