BxCppDev / Bayeux

Core Persistency, Geometry and Data Processing C++ Library for Particle and Nuclear Physics Experiments
GNU General Public License v3.0
4 stars 9 forks source link

Warning on use of bitwise or on non-zero value in mygsl #62

Closed drbenmorgan closed 4 years ago

drbenmorgan commented 4 years ago

In working through warnings on #61, one that popped up that I wasn't 100% sure how to resolve is this

[399/1188] Building CXX object source/CMakeFiles/Bayeux.dir/bxmygsl/src/seed_manager.cc.o
../source/bxmygsl/src/seed_manager.cc:139:25: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare]
  if (_init_seed_flags_ | INIT_SEED_FROM_RANDOM_DEVICE) {
      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Looking at the context:

https://github.com/BxCppDev/Bayeux/blob/a1d81bd55f4de7c94010393f836a84b530e06a98/source/bxmygsl/src/seed_manager.cc#L139-L142

it looks like the logic should be bitwise and rather than or?

fmauger commented 4 years ago

This is a typo. Should be and (&). I fix it.