gap-packages / guava

GAP package guava - computations relative to error-correcting codes
https://gap-packages.github.io/guava
Other
13 stars 7 forks source link

Strict prototype warnings #90

Closed orlitzky closed 11 months ago

orlitzky commented 11 months ago

When building with -Wstrict-prototypes, several warnings of the following form are emitted:

In file included from src/ctjhai/minimum-weight-gf2.c:40:
src/ctjhai/popcount.h:26:19: warning: a function declaration
      without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void init_popcount();
                  ^
                   void

What's the problem? It turns out that (despite all compilers accepting it for basically forever) a declaration of foo() in C doesn't mean "no arguments." Instead, it means that the number and type of arguments is unspecified. Here, the warning is simply complaining that init_popcount should either have a prototype specifying the arguments, or itself be declared init_popcount(void).

This isn't a big deal today, but C23 will likely make this an error. We're trying to report these issues early so that there isn't a build armageddon when the new standard is released, see e.g. https://wiki.gentoo.org/wiki/Modern_C_porting

osj1961 commented 11 months ago

Fixed with 76e3abd

orlitzky commented 11 months ago

Thanks!