This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Avoid -Wno-write-strings for k_standard.c [committed]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]