• Nicolas Dusart's avatar
    Simclist: avoid to divide by zero in list_findpos() · 0127d3c7
    Nicolas Dusart authored
    A division by zero with float is undefined in C.
    For example gcc 6.3.0 reports (when detected):
    dividebyzero.c:5:20: warning: division by zero [-Wdiv-by-zero]
      float a = (float)1/0;
    
    But the code does NOT crash. The value of a is just infinity.
    
    The problem is when Free Pascal runtime is used. In this case the code crashed.
    0127d3c7
Name
Last commit
Last update
UnitaryTests Loading commit data...
doc Loading commit data...
etc Loading commit data...
m4 Loading commit data...
src Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
DRIVERS Loading commit data...
GPL-3.0.txt Loading commit data...
HELP Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
README.md Loading commit data...
SECURITY Loading commit data...
TODO Loading commit data...
bootstrap Loading commit data...
c.sh Loading commit data...
clang-analyze.sh Loading commit data...
configure.ac Loading commit data...
splint.sh Loading commit data...
stamp-h.in Loading commit data...