I get the following compiler warnings in dlls/ntdll/tests/rtlstr.c:
gcc -c -I. -I. -I../../../include -I../../../include -g -O2 -Wall -mpreferred-stack-boundary=2 -fPIC -DNONAMELESSUNION -DNONAMELESSSTRUCT -D_REENTRANT -o rtlstr.o rtlstr.c rtlstr.c: In function `test_RtlInitUnicodeString': rtlstr.c:110: warning: implicit declaration of function `wcscmp' rtlstr.c: In function `test_RtlUnicodeStringToInteger': rtlstr.c:175: warning: wchar_t format, different type arg (arg 3) rtlstr.c:180: warning: wchar_t format, different type arg (arg 3) rtlstr.c:181: warning: wchar_t format, different type arg (arg 3) rtlstr.c:183: warning: wchar_t format, different type arg (arg 3) rtlstr.c:184: warning: wchar_t format, different type arg (arg 3) rtlstr.c:186: warning: wchar_t format, different type arg (arg 3) rtlstr.c:187: warning: wchar_t format, different type arg (arg 3) rtlstr.c:189: warning: wchar_t format, different type arg (arg 3) rtlstr.c:190: warning: wchar_t format, different type arg (arg 3)
(Actually, before the patch I just sent in, there were a couple more.)
Two questions: 1. what .h file should tests/rtlstr.c include to get wcscmp? Posix says one thing, MSDN says a similar thing, but I want to get the path right. 2. The whcar_t format warnings might be serious -- isn't posix's wchar_t different from win32's wchar_t? - Dan
On Wed, 25 Dec 2002, Dan Kegel wrote:
I get the following compiler warnings in dlls/ntdll/tests/rtlstr.c:
gcc -c -I. -I. -I../../../include -I../../../include -g -O2 -Wall -mpreferred-stack-boundary=2 -fPIC -DNONAMELESSUNION -DNONAMELESSSTRUCT -D_REENTRANT -o rtlstr.o rtlstr.c rtlstr.c: In function `test_RtlInitUnicodeString': rtlstr.c:110: warning: implicit declaration of function `wcscmp' rtlstr.c: In function `test_RtlUnicodeStringToInteger': rtlstr.c:175: warning: wchar_t format, different type arg (arg 3)
[...]
- what .h file should tests/rtlstr.c include to get wcscmp? Posix says one thing, MSDN says a similar thing, but I want to get the path right.
It would be better to use strcmpW instead. AFAIK, wcslen will either be the glibc version, i.e. it takes 4 bytes chars, or it is the msvcrt implementation and thus requires that you link with msvcrt.dll. By using strcmpW you will avoid both problems (and many tests already use strlenW which comes from the same place, our wine/unicode.h).