Page 1 of 1

clib2 wchar issues

Posted: Thu Jun 18, 2015 12:39 pm
by Daytona675x
Hi, just stepped into two problems regarding clib2 and some wchar functions. Most likely there's more but so far I only tried to use those:

In clib2/include/wchar.h:
The prototype for vswprintf is wrong, the destination pointer is a simple char* while it should be a wchar_t*.
It should be

Code: Select all

int vswprintf(wchar_t* ws,const wchar_t* format,va_list arg);
or even better

Code: Select all

int vswprintf(wchar_t* ws,size_t len,const wchar_t* format,va_list arg);
(although that would probably be vsnwprintf then, other implementations are not really consequent / consistent here too ;) ).

In clib2/include/wctype.h:
at least towupper isn't implemented it seems, at least the linker complains that it doesn't exist.

Re: clib2 wchar issues

Posted: Thu Jun 18, 2015 7:56 pm
by eliyahu
@Daytona675x

nice find. have you thought about fixing it directly? clib2 is an open-source component and the header you're referencing is available here: http://clib2.cvs.sourceforge.net/viewvc ... y/include/

-- eliyahu

Re: clib2 wchar issues

Posted: Fri Aug 14, 2015 10:21 am
by Daytona675x
Ah, didn't know that it was open-source, thanks for that info.
However, I don't have free time left to fix every bug I run into on my own :-) I'll leave that to the people already involved with it.

Re: clib2 wchar issues

Posted: Fri Aug 14, 2015 10:45 am
by salass00
The clib2 repository has been moved so that it's now hosted under the adtools group on github:
https://github.com/adtools/clib2

If anyone wants to make improvements to clib2 I think this is where they should be made.