This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Ping Re: Make strtod respect the rounding mode (bug 14518)
On Thu, 6 Sep 2012, Roland McGrath wrote:
> rounding-mode.h is not an installed header. So include/ and bits/ are not
> appropriate for it.
The model I was following is atomic.h and bits/atomic.h. But there are
plenty of other include/ headers that are not installed and are not
wrapping installed headers, and some other bits/ headers.
> Instead, just put the common part in
> sysdeps/generic/rounding-mode.h and make sysdeps/.../rounding-mode.h files
> include that explicitly by name.
That seems to complicate unduly providing the generic version of
get_rounding_mode based on fpu_control.h - sysdeps files would need to
define some macro telling the generic header not to define the generic
version, rather than just providing a single inline function as at
present. (The generic header has to be included before the
get_rounding_mode function is defined, since the generic header provides
the return type for that function.) I think there is a natural separation
into two headers here, the header providing the rounding_mode_t type and
the round_away function (only one version) and the header providing the
get_rounding_mode function (multiple versions including a generic one that
some architectures but not others override), with the latter being
included by the former. I don't think combining the generic
bits/rounding-mode.h with the all-architectures include/rounding-mode.h
makes sense. And include/rounding-mode.h doesn't go directly in stdlib/
because it will be used in printf as well; it's an internal,
system-independent header shared by multiple directories.
--
Joseph S. Myers
joseph@codesourcery.com