tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

gcc knows about sincos even though NetBSD doesn't



Hi!

With -current as of about a week ago (gcc 10.3.0) I see a confusing
warning.

The following test input:

#include <limits.h>

int main() {
return sincos();
}

when compiled with "gcc -o test test.c" gives:


test.c: In function ‘main’:
test.c:4:8: warning: implicit declaration of function ‘sincos’ [-Wimplicit-function-declaration]
    4 | return sincos();
      |        ^~~~~~
test.c:4:8: warning: incompatible implicit declaration of built-in function ‘sincos’
test.c:2:1: note: include ‘<math.h>’ or provide a declaration of ‘sincos’
    1 | #include <limits.h>
  +++ |+#include <math.h>
    2 |
test.c:4:8: error: too few arguments to function ‘sincos’
    4 | return sincos();
      |        ^~~~~~


The first part is fine, but the warning to include math.h is
misguided, since NetBSD does not have sincos at all.

(see also https://gitlab.gnome.org/GNOME/gtk/-/issues/5070 )

 Thomas



Home | Main Index | Thread Index | Old Index