Hi John,
> 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
the manpage mentions that wcscasecmp() is a GNU extension. Out of
curiosity, I tried sticking a '#define _GNU_SOURCE' line at the top of
the .cpp file, and it compiled and ran fine. I wouldn't claim to know
/why/ it works, but it might help anyway.
blah
-kev
P.S. - I'm also using gcc2.96
On Prickle-Prickle, the 38th day of Confusion, John_White at dell.com declared:
> 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.
>>>> --
> Irish Linux Users' Group: ilug at linux.ie>http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
> List maintainer: listmaster at linux.ie
--
Science is facts; just as houses are made of stones so
is science made of facts; but a pile of stones is not a
house, and a collection of facts is not necessarily a
science
-Henri Poincare
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!