2.1.95 result - II - make check (failed, patch attached)

Joseph S. Myers jsm28@cam.ac.uk
Tue Oct 10 02:37:00 GMT 2000


On Tue, 10 Oct 2000, Matthew Clarke wrote:

> I also note in passing the following compiler warnings in tst-swprintf.c
> in stdio-common (copy'n'pasted), in case anyone's interested:
> 
> tst-swprintf.c:45: warning: long int format, different type arg (arg 3)
> tst-swprintf.c:45: warning: long int format, different type arg (arg 3)

Indeed, input[] can't be both a wide and a multibyte string.  %s (both for
narrow and wide functions) expects a multibyte string; %ls (both for
narrow and wide functions) expects a wide string.  If input[] is
multibyte, being passed to %s formats for swprintf, then it shouldn't be
passed to %ls for printf.  If it's wide, it should be passed to %ls in
both cases (and should be of the right type, array of wchar_t).  At
present the swprintf gets %s formats for input[], and the printf gets %ls
(twice for each CHECK invocation).

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Libc-alpha mailing list