This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Bug or feature?
- To: egcs at cygnus dot com
- Subject: Bug or feature?
- From: Martin Kahlert <martin dot kahlert at mchp dot siemens dot de>
- Date: Wed, 4 Nov 1998 08:34:48 +0100
Hi,
please give me a hint:
Is this a bug or a feature:
The pow funcion doesn't reset errno to 0, if all is o.k.
See the following prog:
gcc -v:
Reading specs from
/sw/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
cat h.c:
#include <errno.h>
#include <math.h>
#include <stdio.h>
int main(int argc,const char *argv[])
{
double w;
printf("errno=%d\n",errno);
w=pow(-1.17,0.37);
printf("errno=%d\n",errno);
w=pow(1.17,0.37);
printf("errno=%d\n",errno);
errno=0;
w=pow(1.17,0.37);
printf("errno=%d\n",errno);
return 0;
}