]> sourceware.org Git - glibc.git/commitdiff
Fix swscanf vswscanf namespace (bug 18542).
authorJoseph Myers <joseph@codesourcery.com>
Wed, 17 Jun 2015 20:15:22 +0000 (20:15 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 17 Jun 2015 20:15:22 +0000 (20:15 +0000)
swscanf (added in C90 Amendment 1, present in UNIX98) calls vswscanf
(added in C99, not in C90 Amendment 1 or UNIX98).  This patch fixes
this by using __vswscanf instead and making vswscanf into a weak
alias.

(I intend to add conform/ test support for C90 Amendment 1 - and
various other standard versions supported by glibc but not yet by
conform/ tests - at some point, once the results for currently tested
standards are cleaner.)

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

[BZ #18542]
* libio/iovswscanf.c (__vswscanf): Use libc_hidden_def.
(vswscanf): Use ldbl_weak_alias instead of ldbl_strong_alias
* include/wchar.h (__vswscanf): Declare.  Use libc_hidden_proto.
* libio/swscanf.c (__swscanf): Call __vswscanf instead of
vswscanf.
* conform/Makefile (test-xfail-UNIX98/wchar.h/linknamespace):
Remove variable.

ChangeLog
NEWS
conform/Makefile
include/wchar.h
libio/iovswscanf.c
libio/swscanf.c

index 046b1ae27d9bcecb616c43304c5b7277677a84ab..ea4aeebaadd298bcc3a4e9684f775ccced986328 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2015-06-17  Joseph Myers  <joseph@codesourcery.com>
 
+       [BZ #18542]
+       * libio/iovswscanf.c (__vswscanf): Use libc_hidden_def.
+       (vswscanf): Use ldbl_weak_alias instead of ldbl_strong_alias
+       * include/wchar.h (__vswscanf): Declare.  Use libc_hidden_proto.
+       * libio/swscanf.c (__swscanf): Call __vswscanf instead of
+       vswscanf.
+       * conform/Makefile (test-xfail-UNIX98/wchar.h/linknamespace):
+       Remove variable.
+
        [BZ #18540]
        * libio/iofflush.c [!_IO_MTSAFE_IO] (__fflush_unlocked): Define as
        strong alias of _IO_fflush.  Use libc_hidden_def.
diff --git a/NEWS b/NEWS
index 17a11aba16ac290a8003c2aaacdd1e1122365e7b..d501b3124349ea17cd1f454c926ae8272f36b37a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,7 +22,7 @@ Version 2.22
   18324, 18333, 18346, 18397, 18409, 18410, 18412, 18418, 18422, 18434,
   18444, 18468, 18469, 18470, 18479, 18483, 18495, 18496, 18497, 18498,
   18507, 18512, 18519, 18520, 18522, 18527, 18528, 18529, 18530, 18532,
-  18533, 18534, 18536, 18539, 18540.
+  18533, 18534, 18536, 18539, 18540, 18542.
 
 * Cache information can be queried via sysconf() function on s390 e.g. with
   _SC_LEVEL1_ICACHE_SIZE as argument.
index 32d29850e2ffcf229b60bd09a513b97af7117185..0b061037cd2ead0122cbaae813f9b42391800a0c 100644 (file)
@@ -348,4 +348,3 @@ test-xfail-XPG3/unistd.h/linknamespace = yes
 test-xfail-XPG4/unistd.h/linknamespace = yes
 test-xfail-POSIX/mqueue.h/linknamespace = yes
 test-xfail-UNIX98/mqueue.h/linknamespace = yes
-test-xfail-UNIX98/wchar.h/linknamespace = yes
index 449ad1d68508ffe5602f20d09ae18d3737984609..67d0248f001d57d50d3328b63f3de3ccf1a2047b 100644 (file)
@@ -197,7 +197,11 @@ extern int __isoc99_vwscanf (const wchar_t *__restrict __format,
 extern int __isoc99_vswscanf (const wchar_t *__restrict __s,
                              const wchar_t *__restrict __format,
                              __gnuc_va_list __arg) __THROW;
+extern int __vswscanf (const wchar_t *__restrict __s,
+                      const wchar_t *__restrict __format,
+                      __gnuc_va_list __arg) __THROW;
 libc_hidden_proto (__isoc99_vswscanf)
+libc_hidden_proto (__vswscanf)
 libc_hidden_proto (__isoc99_vfwscanf)
 
 /* Internal functions.  */
index 7ee3597c52d0d0ccbf9ce51fa92ac3a612b2ce8f..a228641a853e8b6fb67ae8a3a26b54071876acbf 100644 (file)
@@ -43,5 +43,6 @@ __vswscanf (const wchar_t *string, const wchar_t *format, _IO_va_list args)
   ret = _IO_vfwscanf ((_IO_FILE *) &sf._sbf, format, args, NULL);
   return ret;
 }
+libc_hidden_def (__vswscanf)
 ldbl_hidden_def (__vswscanf, vswscanf)
-ldbl_strong_alias (__vswscanf, vswscanf)
+ldbl_weak_alias (__vswscanf, vswscanf)
index 9e4c256d244fbe68335fbfaae79852bc7729554f..397dbc554ceb4e3fc5f849a7d1e2302ce47ef387 100644 (file)
@@ -28,7 +28,7 @@ __swscanf (const wchar_t *s, const wchar_t *format, ...)
   int done;
 
   va_start (arg, format);
-  done = vswscanf (s, format, arg);
+  done = __vswscanf (s, format, arg);
   va_end (arg);
 
   return done;
This page took 0.13243 seconds and 5 git commands to generate.