This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Avoid -Wno-write-strings for k_standard.c [committed]
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Chris Metcalf <cmetcalf at ezchip dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 27 Feb 2015 01:19:48 +0000
- Subject: Re: Avoid -Wno-write-strings for k_standard.c [committed]
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1502262251180 dot 11532 at digraph dot polyomino dot org dot uk> <54EFB689 dot 6080807 at ezchip dot com>
On Thu, 26 Feb 2015, Chris Metcalf wrote:
> It seems like this code would benefit from a comment as to why it makes
> sense here to cast away const from a truly const string. It wasn't true in
> the original either, but now the cast is further from the assignment to
> exc.name,
> so it seems like it would be helpful now to document.
I've applied this patch. At some point we'll probably obsolete the
matherr interface, _LIB_VERSION, libieee.a and this code (moving to new
symbol versions of libm functions that don't check _LIB_VERSION at runtime
and separate __*_noerrno functions selected by -fno-math-errno to replace
use of -lieee to bypass wrapper code for setting errno if such bypasses
are considered useful), at which point the version of the exception
structure used to compile this code for binary compatibility could use a
pointer to const, but until then these casts are needed.
2015-02-27 Joseph Myers <joseph@codesourcery.com>
* sysdeps/ieee754/k_standard.c (CSTR): Add comment.
diff --git a/sysdeps/ieee754/k_standard.c b/sysdeps/ieee754/k_standard.c
index 00bedc9..c8aebbf 100644
--- a/sysdeps/ieee754/k_standard.c
+++ b/sysdeps/ieee754/k_standard.c
@@ -105,6 +105,7 @@ __kernel_standard(double x, double y, int type)
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
#endif
+ /* The SVID struct exception uses a field "char *name;". */
#define CSTR(func) ((char *) (type < 100 \
? func \
: (type < 200 ? func "f" : func "l")))
--
Joseph S. Myers
joseph@codesourcery.com