Fix gcc12 warnings

I'm getting a few weird warnings when building Gaudi in optimized mode with gcc 12:

For the first case I decided to hide the warning (432b2972) and for the second I refactored slightly the code (de9ab00c).

Merge request reports

Loading