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

freetypecheck compares versions using lexicographic comparison

XMLWordPrintable

    • b00
    • master
    • generic
    • generic

      Bizarrely, the freetypecheck build tool in OpenJDK 7 and below converts the FreeType major, minor and patch version numbers from its header files and library into a dotted string, before comparing it with REQUIRED_FREETYPE_VERSION (currently 2.3.0) using strcmp.

      While this works when all the version numbers are single digits, it fails as soon as we run into comparisons with numbers of 10 and up.

      With FreeType 2.10.0 released in March 2019, the version check now fails, believing 2.10.0 to be older than 2.3.0, because the character '1' is smaller than the character '3'.

      We can fix this by instead converting "2.3.0" into its component version numbers and comparing them numerically with those obtained from FreeType.

            andrew Andrew Hughes
            andrew Andrew Hughes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: