> At link time, I got "libxerces-c1_0.so: undefined reference to
> `IconvTransService::IconvTransService(void)'" so hunted around for this
> file. I switched into c/src/util/Transcoders/Iconv and did a make, but
> gcc complained with
> 
> IconvTransService.cpp:126: ANSI C++ forbids comparison between pointer
> and integer
> IconvTransService.cpp:126: ANSI C++ forbids comparison between pointer
> and integer
> 
> and again on line 150. I fixed this with (CVS output here)
> 
> --- diff begins ---
> diff -u -r1.3 IconvTransService.cpp
> --- IconvTransService.cpp       1999/11/20 00:28:19     1.3
> +++ IconvTransService.cpp       1999/12/02 17:16:34
> @@ -123,7 +123,7 @@
>      const XMLCh* cptr1 = comp1;
>      const XMLCh* cptr2 = comp2;
> 
> -    while ((*cptr1 != NULL) && (*cptr2 != NULL))
> +    while ((*cptr1 != '\0') && (*cptr2 != '\0'))
>      {
>          wint_t  wch1 = towupper(*cptr1);
>          wint_t  wch2 = towupper(*cptr2);
> @@ -147,7 +147,7 @@
>      const XMLCh* cptr2 = comp2;
> 
>      unsigned int  n = 0;
> -    while ((*cptr1 != NULL) && (*cptr2 != NULL) && (n < maxChars))
> +    while ((*cptr1 != '\0') && (*cptr2 != '\0') && (n < maxChars))
>      {
>          wint_t  wch1 = towupper(*cptr1);
>          wint_t  wch2 = towupper(*cptr2);
> --- diff ends ---
> 
> But it seems the sort of thing that would have been picked up by others
> before now.


Thank you Michael for pointing this out. I swear that I compiled
the file successfully before commiting the changes. I must have
been on a different platform/compiler which did not care.

Anyway, I ack. that use of NULL is incorrect in these instances.
I have fixed the code and checked in the change.


> There are some further warnings "warning: passing `const int
> *' as argument 2 of `towctrans(unsigned int, const unsigned int *)'
> changes signedness" too. I'm compiling on a Redhat 5.2(ish) box after
> using the runConfigure script with "-p linux -c gcc -x g++ -t native".

We would eventually like to get rid of all these warnings. For, now
as long as the code works, we will have to live with them.


rahul

Reply via email to