Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8304843

jboolean should be defined as proper C booleans

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Withdrawn
    • P4
    • None
    • None
    • hotspot
    • None

    Description

      Since C99 C has had support for proper booleans, use of which is beneficial since they behave very much like conventional booleans: They can only take 2 values, and have very different sets of rules regarding implicit conversion which makes them behave as one would expect booleans to. All their special properties would eliminate a whole host of possible bugs that conventionally would have to be carefully avoided when using the age old trick of pretending character types are on/off switches, and we stand to gain a lot by using them instead of the current definitions we have now, and we can even be sure that they can only ever be true or false when checking their values in implementations of our own native libraries.

      C++ has always had a built-in bool, so this would not be an issue for it either

      Attachments

        Activity

          People

            dholmes David Holmes
            jwaters Julian Waters
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: