gcc knows about sincos even though NetBSD doesn't

Thomas Klausner <[email protected]>
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <YuQAwE0gHcQI/[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.