Mail Archives: djgpp-workers/2003/06/22/15:54:59.2
Hello.
ams AT ludd DOT luth DOT se wrote:
> Here's a patch to add fpclassify to libc.
Thanks! Mostly looks good. But:
> Note that I kept __attribute((const)) in the texinfo file.
[snip]
I don't think we should keep this in the documentation. I think the
documentation should have the ANSI declaration, if it's an ANSI function (*).
__attribute__((const)) is an implementation detail - a gcc-ism. I'm also don't
think the user cares that it has this attribute. The user may care about
__attribute((noreturn)).
libc seems to use __attribute__, not __attribute. Please use __attribute__ to
be consistent with the rest of the library.
Can you write some tests, please? Maybe you have some, but forgot to include
them.
Out of interest: why did you write this in assembler rather than C? To avoid
the type-punning unions (float_t, etc.)?
I have some documentation corrections:
[snip]
> Index: djgpp/src/libc/c99/math/fpclassd.txh
> ===================================================================
> RCS file: djgpp/src/libc/c99/math/fpclassd.txh
> diff -N djgpp/src/libc/c99/math/fpclassd.txh
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ djgpp/src/libc/c99/math/fpclassd.txh 21 Jun 2003 14:03:16 -0000
> @@ -0,0 +1,43 @@
> +@ignore
> + * File fpclassl.txh.
> + *
> + * Copyright (C) 2003 Martin Str@"omberg <ams AT ludd DOT luth DOT se>.
> + *
> + * This software may be used freely so long as this copyright notice is
> + * left intact. There is no warranty on this software.
> + *
> +@end ignore
> +
> +@node __fpclassifyd, math
> +@findex __fpclassifyd
> +@subheading Syntax
> +
> +@example
> +#include <math.h>
> +
> +int __fpclassifyd(double) __attribute((const));
> +@end example
> +
> +@subheading Description
> +
> +Returns the kind of the floating point value supplied. You should use
> +the type generic macro @code{fpclassify} instead of this
Can you add a cross-reference, please? E.g. (@pxref{fpclassify}).
> +
> +@subheading Return Value
> +
> +FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL or FP_ZERO.
> +
> +@subheading Portability
> +
> +@portability !ansi-c89, ansi-c99
> +
> +@subheading Example
> +
> +@example
> +if( __fpclassifyf(0.0) != FP_ZERO )
Typo: __fpclassifyf -> __fpclassifyd.
[snip]
> Index: djgpp/src/libc/c99/math/fpclassf.txh
> ===================================================================
> RCS file: djgpp/src/libc/c99/math/fpclassf.txh
> diff -N djgpp/src/libc/c99/math/fpclassf.txh
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ djgpp/src/libc/c99/math/fpclassf.txh 21 Jun 2003 14:03:17 -0000
> @@ -0,0 +1,43 @@
> +@ignore
> + * File fpclassl.txh.
> + *
> + * Copyright (C) 2003 Martin Str@"omberg <ams AT ludd DOT luth DOT se>.
> + *
> + * This software may be used freely so long as this copyright notice is
> + * left intact. There is no warranty on this software.
> + *
> +@end ignore
> +
> +@node __fpclassifyf, math
> +@findex __fpclassifyf
> +@subheading Syntax
> +
> +@example
> +#include <math.h>
> +
> +int __fpclassifyf(float) __attribute((const));
> +@end example
> +
> +@subheading Description
> +
> +Returns the kind of the floating point value supplied. You should use
> +the type generic macro @code{fpclassify} instead of this function.
Can you add a cross-reference, please? E.g. (@pxref{fpclassify}).
[snip]
> Index: djgpp/src/libc/c99/math/fpclassl.txh
> ===================================================================
> RCS file: djgpp/src/libc/c99/math/fpclassl.txh
> diff -N djgpp/src/libc/c99/math/fpclassl.txh
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ djgpp/src/libc/c99/math/fpclassl.txh 21 Jun 2003 14:03:17 -0000
> @@ -0,0 +1,43 @@
> +@ignore
> + * File fpclassl.txh.
> + *
> + * Copyright (C) 2003 Martin Str@"omberg <ams AT ludd DOT luth DOT se>.
> + *
> + * This software may be used freely so long as this copyright notice is
> + * left intact. There is no warranty on this software.
> + *
> +@end ignore
> +
> +@node __fpclassifyld, math
> +@findex __fpclassifyld
> +@subheading Syntax
> +
> +@example
> +#include <math.h>
> +
> +int __fpclassifyld(long double) __attribute((const));
> +@end example
> +
> +@subheading Description
> +
> +Returns the kind of the floating point value supplied. You should use
> +the type generic macro @code{fpclassify} instead of this function.
Can you add a cross-reference, please? E.g. (@pxref{fpclassify}).
> +
> +@subheading Return Value
> +
> +FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO or FP_UNNORMAL.
> +
> +@subheading Portability
> +
> +@portability !ansi-c89, ansi-c99
> +
> +@subheading Example
> +
> +@example
> +if( __fpclassifyf(0.0L) != FP_ZERO )
Typo: __fpclassifyf -> __fpclassifyld.
[snip]
Thanks, bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -