Mornin all . . . . gcc seems to treat wcscasecmp() differently if it is
behaving as a C++ compiler rather than a C compiler. With the below inside a
string.c and inside a string.cpp I get . . .
/* begin */
#include <wchar.h>
#include <stdio.h>
int main()
{
wchar_t String1[] = L"New";
wchar_t String2[] = L"new";
printf("%S == %S ? %d\n", String1, String2, (0 == wcscasecmp(String1,
String2)));
return(0);
}
/* end */
[~/test $]cc -o string1 string.c
[~/test $]cc -o string2 string.cpp
cstring.cpp: In function `int main()':
cstring.cpp:10: warning: implicit declaration of function `int
wcscasecmp(...)'
[~/test $]
extern "C" { ... } in the appropriate place doesn't seem to help . . .
Other wide char functions are fine . . . .
Both resulting binaries seem to work fine . . . .
This is using a very old compiler ( egcs-2.91.66 - RH6.0 ) but I don't
have a more recent one to hand . . . do others see the same thing ?
Any help very much appreciated.
John.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!