davidrmiller/biosim4

Exception on run.

Ccode-lang opened this issue · 4 comments

pi@raspberrypi:~/biosim4 $ ./bin/Debug/biosim4 biosim4.ini
Floating point exception

It doesn't even tell any other info.

found a warning in build that might be causing it.

src/basicTypes.cpp:154:30: warning: left shift count >= width of type [-Wshift-count-overflow]
  154 |     len = (len + temp) / (1L << 32); // Divide to make sure we get an arithmetic shift
      |                           ~~~^~~~~
src/basicTypes.cpp:154:24: warning: division by zero [-Wdiv-by-zero]
  154 |     len = (len + temp) / (1L << 32); // Divide to make sure we get an arithmetic shift
      |           ~~~~~~~~~~~~~^~~~~~~~~~~~

Thanks for reporting this. Issue #74 mentioned a similar error in the same source file where some 1L constants needed to be changed to 1LL when they appear in a 64-bit expression on a raspi. It looks like we didn't catch them all. We probably need to change the 1L to 1LL in lines 153 and 154 as well. I'll test that change and update the main branch.

Edit: tested and main branch updated.

Thanks, I'll test in a bit.

Works, Thanks!