This is the mail archive of the libc-alpha@sources.redhat.com 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]

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


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


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