More compiler warnings
Description
More compiler flags for GFortran:
-
-fno-var-track-assignment
is added - Add a missing CMake option
Octopus_DEBUG
to allow to set NDEBUG for the preprocessing - Fix the compilation with no debugging
- Add
-Wextra
for the C and C++ compilers
Importantly, I also made all the changes to allow the code to compile with the F2008 standard.
- The warning builder is now enforcing this.
- I removed the nonstandard functions
loc
,sizeof
,flush
, andisnan
. - The preprocessor macros
HAVE_FLUSH
,HAVE_FORTRAN_LOC
are now removed.
Note that for GCC, the -fconversion
warning is not activated by Wall, from the documentation. I tried to activate it but we have currently too many warnings, so I removed it for the moment. Most are integer conversions, but I found one worrying warning #1184 .
I also tried the warning of temporary arrays and left-hand side reallocation, but there are simply too many of these. Ultimately, we should fix the first one, as this avoids ugly code (mostly array manipulation in function calls), and check for the second one to avoid it in critical code path.
Checklist
-
I have checked that my code follows the Octopus coding standards -
I have added tests for all the new features added in this request.
Edited by Nicolas Tancogne-Dejean