public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* jboolean is an unsigned type
       [not found]             ` <bf0c3b3f0907210144g51dc6861nad9b29574e43ac93@mail.gmail.com>
@ 2010-02-24 15:34               ` Andrew Haley
  0 siblings, 0 replies; only message in thread
From: Andrew Haley @ 2010-02-24 15:34 UTC (permalink / raw)
  To: Mathieu Malaterre; +Cc: Florian Weimer, GCJ-patches

This fixes a bug that goes back many, many years.

Inside the compiler jboolean is an unsigned type, but in the library
jboolean is a signed type.  We got away with this by accident.

I've done a fair bit of testing, and I'm pretty sure this won't break
any BC-compiled programs: none of the signatures change, for example.
It is possible that some CNI programs that hitherto have worked by
accident will break; we'll see.

Andrew.


2010-02-24  Andrew Haley  <aph@redhat.com>

        PR java/40816
        * include/jni_md.h: jboolean is an unsigned type.

Index: include/jni_md.h
===================================================================
--- include/jni_md.h    (revision 157011)
+++ include/jni_md.h    (working copy)
@@ -78,7 +78,7 @@
 typedef int    jshort __attribute__((__mode__(__HI__)));
 typedef int    jint   __attribute__((__mode__(__SI__)));
 typedef int    jlong  __attribute__((__mode__(__DI__)));
-typedef int    jboolean __attribute__((__mode__(__QI__)));
+typedef unsigned int   jboolean __attribute__((__mode__(__QI__)));
 typedef unsigned short jchar __attribute__((__mode__(__HI__)));
 typedef float  jfloat;
 typedef double jdouble;
@@ -99,7 +99,7 @@
 typedef float jfloat;
 typedef double jdouble;
 typedef jint jsize;
-typedef int8_t jboolean;
+typedef uint8_t jboolean;
 typedef uint16_t jchar;
 
 #  else /* JV_HAVE_INTTYPES_H */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-02-24 15:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bf0c3b3f0907160537g2b52ccf8ydd39df0d2ae54e3c@mail.gmail.com>
     [not found] ` <87ab31nrc2.fsf@mid.deneb.enyo.de>
     [not found]   ` <4A62D0B7.6010301@redhat.com>
     [not found]     ` <87eisddr3y.fsf@mid.deneb.enyo.de>
     [not found]       ` <4A6338DE.7040700@redhat.com>
     [not found]         ` <bf0c3b3f0907210016w50a4201oebec02bb77ecba3e@mail.gmail.com>
     [not found]           ` <4A6572E0.2060006@redhat.com>
     [not found]             ` <bf0c3b3f0907210144g51dc6861nad9b29574e43ac93@mail.gmail.com>
2010-02-24 15:34               ` jboolean is an unsigned type Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).