Skip to content

Commit

Permalink
Avoid -Wno-write-strings for k_standard.c.
Browse files Browse the repository at this point in the history
We want to avoid -Wno- options in makefiles as far as possible, by
cleaning up the underlying issues if possible or failing that by using
diagnostic pragmas.  This patch eliminates the use of
-Wno-write-strings for sysdeps/ieee754/k_standard.c by using casts in
the source file to cast away const; those casts are encapsulated in a
macro that also deals with the choice of strings for float / double /
long double functions (for which the logic was previously replicated
many times).

Tested for x86_64; the only change to disassembly of installed
stripped shared libraries was a line number in an assertion.

	* sysdeps/ieee754/k_standard.c (CSTR): New macro.
	(__kernel_standard): Use CSTR macro when setting exc.name.
	* sysdeps/ieee754/Makefile [$(subdir) = math]
	(CFLAGS-k_standard.c): Remove variable.
  • Loading branch information
Joseph Myers committed Feb 26, 2015
1 parent 09220e6 commit 31331a0
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 81 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
2015-02-26 Joseph Myers <joseph@codesourcery.com>

* sysdeps/ieee754/k_standard.c (CSTR): New macro.
(__kernel_standard): Use CSTR macro when setting exc.name.
* sysdeps/ieee754/Makefile [$(subdir) = math]
(CFLAGS-k_standard.c): Remove variable.

* sysdeps/ieee754/dbl-64/e_j0.c (pzero): Change last case for
setting p and q from "else if" to "else".
(qzero): Likewise.
Expand Down
1 change: 0 additions & 1 deletion sysdeps/ieee754/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ifeq ($(subdir),math)
sysdep_headers += ieee754.h
CFLAGS-k_standard.c = -Wno-write-strings
endif

Loading

0 comments on commit 31331a0

Please sign in to comment.