Call to FcConfigAppFontAddFile uses wrong prototype, arguments

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • jfx21
    • Affects Version/s: jfx20
    • Component/s: javafx
    • b23
    • generic
    • generic

      This code

          225 if (text) {
          226 // rc = (jboolean)FcConfigAppFontAddFile(arg0, text);
          227 if (fp) {
          228 rc = (jboolean)((jboolean (*)(void *, const char *))fp)(arg0, text);
          229 }

      is problematic for two reasons: jboolean is unsigned char, but FcBool is int, and arg0 is jlong, not void *, as the prototype suggests. The latter leads to build failures with future compilers.

      The unsigned char/int difference may cause problems on certain platforms, depending on how the calling convention differ.

            Assignee:
            Florian Weimer
            Reporter:
            Florian Weimer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: