This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PR 3426 fix
- To: alk at pobox dot com
- Subject: Re: PR 3426 fix
- From: Tom Tromey <tromey at redhat dot com>
- Date: 17 Jul 2001 18:32:19 -0600
- Cc: java-patches at gcc dot gnu dot org
- References: <15187.54981.893791.754763@spanky.love.edu>
- Reply-To: tromey at redhat dot com
>>>>> "Tony" == Tony Kimball <alk@pobox.com> writes:
Tony> The patch (already applied now) in
Tony> http://gcc.gnu.org/ml/java-patches/2001-q3/msg00060.html
Tony> could use a little more tidying up:
Thanks.
Tony> if (r == (size_t) -1)
Tony> {
Tony> // Incomplete character.
Tony> if (errno == EINVAL)
Tony> return 0;
Tony> - throw new java::io::CharConversionException ();
Tony> + if (errno != E2BIG)
Tony> + throw new java::io::CharConversionException ();
Tony> }
I don't think this is the right thing to do.
I went and read the libc docs on iconv. Now I think the right code
should look like this:
if (errno == EINVAL || errno == E2BIG)
return 0;
The idea is that we throw an exception for EBADF (shouldn't happen) or
EILSEQ (invalid sequence).
Hmm... a comment later on says that glibc 2.1.3 doesn't correctly set
errno. Not sure what to do about that.
What do you think?
Tom