mrc-ide / covid-sim

This is the COVID-19 CovidSim microsimulation model developed by the MRC Centre for Global Infectious Disease Analysis hosted at Imperial College, London.
GNU General Public License v3.0
1.23k stars 257 forks source link

Allow Clang 9 To Build Master #428

Closed ozmorph closed 4 years ago

ozmorph commented 4 years ago

404 introduced 4x compiler errors that prevents Clang 9 from building master.

ozmorph@home:~/covid-sim/build$ clang++-9 --version
clang version 9.0.1-12 
Target: x86_64-pc-linux-gnu
Thread model: posix
/home/ozmorph/covid-sim/src/Update.cpp:1356:33: error: ordered comparison between pointer and zero ('int *' and 'int')
        assert(Cells[cellIndex].latent >= 0);
               ~~~~~~~~~~~~~~~~~~~~~~~ ^  ~
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
                          ^~~~
/home/ozmorph/covid-sim/src/Update.cpp:1357:35: error: ordered comparison between pointer and zero ('int *' and 'int')
        assert(Cells[cellIndex].infected >= 0);
               ~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
                          ^~~~
/home/ozmorph/covid-sim/src/Update.cpp:1368:33: error: ordered comparison between pointer and zero ('int *' and 'int')
        assert(Cells[cellIndex].latent >= 0);
               ~~~~~~~~~~~~~~~~~~~~~~~ ^  ~
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
                          ^~~~
/home/ozmorph/covid-sim/src/Update.cpp:1380:35: error: ordered comparison between pointer and zero ('int *' and 'int')
        assert(Cells[cellIndex].infected >= 0);
               ~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
                          ^~~~
2 warnings and 4 errors generated.

This patch fixes it.