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]

Fix fmtmsg addseverity namespace (bug 18539)


Use of fmtmsg (XSI POSIX) brings in addseverity (non-POSIX).  This
patch fixes this by making addseverity into a weak alias for
__addseverity.

Tested for x86_64 and x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch).

2015-06-15  Joseph Myers  <joseph@codesourcery.com>

	[BZ #18539]
	* stdlib/fmtmsg.c (addseverity): Rename to __addseverity and
	define as weak alias of __addseverity.
	* conform/Makefile (test-xfail-XPG4/fmtmsg.h/linknamespace):
	Remove variable.
	(test-xfail-UNIX98/fmtmsg.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/fmtmsg.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/fmtmsg.h/linknamespace): Likewise.

diff --git a/conform/Makefile b/conform/Makefile
index 873326b..4bbc1e6 100644
--- a/conform/Makefile
+++ b/conform/Makefile
@@ -345,12 +345,8 @@ test-xfail-XOPEN2K8/ndbm.h/linknamespace = yes
 
 # Unsorted expected failures.
 test-xfail-XPG3/unistd.h/linknamespace = yes
-test-xfail-XPG4/fmtmsg.h/linknamespace = yes
 test-xfail-XPG4/unistd.h/linknamespace = yes
 test-xfail-POSIX/mqueue.h/linknamespace = yes
-test-xfail-UNIX98/fmtmsg.h/linknamespace = yes
 test-xfail-UNIX98/mqueue.h/linknamespace = yes
 test-xfail-UNIX98/unistd.h/linknamespace = yes
 test-xfail-UNIX98/wchar.h/linknamespace = yes
-test-xfail-XOPEN2K/fmtmsg.h/linknamespace = yes
-test-xfail-XOPEN2K8/fmtmsg.h/linknamespace = yes
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 6046744..b8133dc 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -347,7 +347,7 @@ internal_addseverity (int severity, const char *string)
 
 /* Add new severity level or remove old one.  */
 int
-addseverity (int severity, const char *string)
+__addseverity (int severity, const char *string)
 {
   int result;
 
@@ -366,6 +366,7 @@ addseverity (int severity, const char *string)
 
   return result;
 }
+weak_alias (__addseverity, addseverity)
 
 
 libc_freeres_fn (free_mem)

-- 
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]