X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=vos%2Fvos.c;h=9876d705b4a7b0893b8f815f45bb00cfa076e468;hb=158b3652342ca691c9e3b061a1d78456ae1a9b4a;hp=a72614c3f32b45cea406f21de721346af0578498;hpb=a5f25d7aeb90fd429ad81529bb602f402d5f9724;p=p5sagit%2Fp5-mst-13.2.git diff --git a/vos/vos.c b/vos/vos.c index a72614c..9876d70 100644 --- a/vos/vos.c +++ b/vos/vos.c @@ -2,6 +2,8 @@ /* Written 02-01-02 by Nick Ing-Simmons (nick@ing-simmons.net) */ /* Modified 02-03-27 by Paul Green (Paul.Green@stratus.com) to add socketpair() dummy. */ +/* Modified 02-04-24 by Paul Green (Paul.Green@stratus.com) to + have pow(0,0) return 1, avoiding c-1471. */ /* End of modification history */ #include @@ -35,3 +37,22 @@ socketpair (int family, int type, int protocol, int fd[2]) { errno = ENOSYS; return -1; } + +/* Supply a private version of the power function that returns 1 + for x**0. This avoids c-1471. Abigail's Japh tests depend + on this fix. We leave all the other cases to the VOS C + runtime. */ + +double s_crt_pow(double *x, double *y); + +double pow(x,y) +double x, y; +{ + if (y == 0e0) /* c-1471 */ + { + errno = EDOM; + return (1e0); + } + + return(s_crt_pow(&x,&y)); +}