mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-20 02:55:47 +00:00
Suppress strict overflow optimization warnings.
This warning is emitted when the compiler performs an optimization, and wants you to verify that the presumptions it is making are valid. For this case we can correctly promise the compiler that the values will not overflow and the optimizations are correct.
This commit is contained in:
parent
06c3389aa7
commit
d2001fb52e
@ -123,6 +123,15 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
// For numerous calls of this function GCC is able to determine if i is
|
||||
// always greater than j ( or vice-versa ) and optimizes those call sites.
|
||||
// But when it does these optimizations is presumes that i and j will not
|
||||
// overflow and emits a Wstrict-overflow warning
|
||||
#ifdef VTKM_GCC
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstrict-overflow"
|
||||
#endif
|
||||
|
||||
// Locate the next vertex in direction indicated
|
||||
template <typename InFieldPortalType>
|
||||
VTKM_EXEC void operator()(const vtkm::Id& vertex,
|
||||
@ -213,7 +222,12 @@ public:
|
||||
linkMask = mask;
|
||||
chain = destination;
|
||||
} // operator()
|
||||
}; // Mesh2D_DEM_VertexStarter
|
||||
|
||||
#ifdef VTKM_GCC
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
}; // Mesh2D_DEM_VertexStarter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user