ISO C99 says that WCHAR_MAX must be a constant expression and the above definition is such an expression. Technically the program needs fixing (see below though for the "standards matter but so do users"), there is nothing wrong with a type cast and a constant value e.g. signed -1 converted to unsigned int (ARM GNU/Linux value for wchar_t).
However, the real issue here is that it differs from x86, the most common architecture, and differences from x86 cause porting problems. The patch itself is insufficient because it doesn't take into account wordsize. When we switch to the 64-bit ARM ABI it should just work. Therefore you need to check for __WORDSIZE and *only* define a value if we are *not* 64-bits. You don't want to define anything for the 64-bit case until the 64-bit ARM ABI is out and finalized.
Thanks for the info, I may look at this later. The ucontext namespace pollution seems to be a bigger issue though.
Your patch to fix ucontext namespace pollution looks good, please post that to libc-ports for review
should I send it immidiately or should I wait until I have test results to give them?
and make sure to state what testing you've done with the patch. At a minimum you should run the glibc testsuite
Afaict the debian packaging automatically runs the testsuite and compares it against a list of expected failures (ideally that list would be empty but in real life....).
Right now i'm running into unexpected testsuite failures (unfortunately the last test build I didn't take a log of so i've got to run it again to find out details of the failures) but I do not know if those failures are related to my patch, related to changes in the build environment since the package was last built in debian or related to my hardware. Further testing will be neeed to establish that (and said testing takes a while, a beagleboard xm isn't exactly a speed demon).
and build gdb with those newly installed headers.
Will do once I get glibc built and installed, are there any specific tests you want doing with gdb or is testing it still builds sufficient??
Cheers, Carlos.
Thanks for the help and advice so-far.