From the man page I learned it is a gnu extension, and that _GNU_SOURCE needs to be defined. So I define it:
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#define _GNU_SOURCE 1
#include <math.h>On a whim I massage the code some:
Code: Select all
#define _GNU_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
#include <math.h>So I think, "that's strange, maybe pow10 is defined in one of the other header files?" I try putting _GNU_SOURCE between stdio and stdlib, but the error returns. It only works when _GNU_SOURCE is defined first, before *any* include files have been included.
My problem is solved, but I'm still curious: how does defining a macro before or after including <stdio.h> have any bearing on what happens when <math.h> is included? There seems to be a strange side-effect going on here. Maybe it is a bug? Maybe I don't understand how _GNU_SOURCE is supposed to operate?
Code: Select all
$ equery list glibc
[ Searching for package 'glibc' in all categories among: ]
* installed packages
[I--] [ ~] sys-libs/glibc-2.8_p20080602-r1 (2.2)
$ gcc --version
gcc (Gentoo 4.3.2 p1.1) 4.3.2

