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

Bug#244610: libc6-dev: No header file declares log2l().



On Wed, Apr 21, 2004 at 04:09:47PM +0900, GOTO Masanori wrote:
> At Wed, 21 Apr 2004 02:17:01 +0100,
> ryutaroh@it.ss.titech.ac.jp wrote:
> > int main(void)
> > {
> >   long double a=0.1;
> >   return (int) log2l(a);
> > }
> > 
> > I got the following warning, which should not happen according
> > to the manual page.
> 
> $ man log2
> 
> CONFORMING TO
>        SVID  3,  POSIX,  BSD 4.3, ISO 9899.  The float and the long double variants
>        are C99 requirements.

The same happen for straight log2() which is not a float or long double
variant.
----to.c----
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
/*double log2(double x);*/
int main(int argc, char **argv)
{
  double x=atof(argv[1]);
  fprintf(stdout,"%g\n",log2(x));
  return 0;
}
% gcc to.c -o to -lm -Wall -O2 -std=c89
to.c: In function `main':
to.c:8: warning: implicit declaration of function `log2'
to.c:8: warning: double format, different type arg (arg 3)

Reading the manpage, it is unwarranted since log2() is conforming to
ISO 9899.

Cheers,
Bill.



Reply to: