michael-hartmann / caps

The Casimir Effect in the plane-sphere geometry.
GNU General Public License v2.0
4 stars 1 forks source link

Zero tolerance for warnings #149

Closed jwuttke closed 4 years ago

jwuttke commented 4 years ago

Under gcc 9.2.1, I get compilation warnings


/G/ext/caps/src/cquadpack/src/dqags.c: In function ‘dqags’:
/G/ext/caps/src/cquadpack/src/dqags.c:179:26: warning: ‘ertest’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  179 |         if ((ierro == 3) || (erlarg <= ertest)) goto _60;
      |             ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/G/ext/caps/src/cquadpack/src/dqags.c:168:16: warning: ‘erlarg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  168 |         erlarg -= erlast;
      |         ~~~~~~~^~~~~~~~~
/G/ext/caps/src/cquadpack/src/dqagi.c: In function ‘dqagi’:
/G/ext/caps/src/cquadpack/src/dqagi.c:190:26: warning: ‘ertest’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  190 |         if ((ierro == 3) || (erlarg <= ertest)) goto _60;
      |             ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/G/ext/caps/src/cquadpack/src/dqagi.c:179:16: warning: ‘erlarg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  179 |         erlarg -= erlast;
      |         ~~~~~~~^~~~~~~~~
[```
jwuttke commented 4 years ago

<- https://github.com/openjournals/joss-reviews/issues/2011

michael-hartmann commented 4 years ago

I have initialized the variables. The details are described in PR #156.

@jwuttke This should fix the warnings reported by gcc 9. Unfortunately, I don't have gcc 9 installed here, so I cannot test it.

michael-hartmann commented 4 years ago

I have verified that with gcc 9.2.1 (gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2)) there are no warnings when compiling the code.