JDK-8215130 : Fix errors in LittleCMS 2.9 reported by GCC 8
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 9,10,11,12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-12-10
  • Updated: 2020-08-31
  • Resolved: 2019-02-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 Other
11.0.10-oracleFixed 13 b09Fixed openjdk8u232Fixed
Related Reports
Relates :  
Description
GCC 8 reports an error:

cmsxform.c:839:50: error: cast between incompatible function types from '_cmsTransform2Fn' {aka 'void (*)(struct _cmstransform_struct *, const void *, void *, unsigned int, unsigned int, const struct )'} to 'void ()(struct _cmstransform_struct *, const void *, void , cmsUInt32Number, cmsUInt32Number)' {aka 'void ()(struct _cmstransform_struct *, const void *, void *, unsigned int, unsigned int)'} [-Werror=cast-function-type]
p->OldXform = (_cmsTransformFn) p->xform;
^

It is fixed by a cast through void* in current mainline (still 2.9 based) of the library:

https://github.com/mm2/Little-CMS/commit/8005ab02c3be0680fecc7c86d719b6c2545b5671
Comments
I'd like to request a backport to increase buildability with newer toolchains. I've tested this on both 8u and 11u; the patch backports with only the usual path corrections on 8u.
16-08-2019

For webrev.00 [Mach5] mach5-one-dchuyko-JDK-8215130-20190111-1036-17681: PASSED
11-01-2019

https://mail.openjdk.java.net/pipermail/2d-dev/2019-January/009808.html
11-01-2019

http://cr.openjdk.java.net/~dchuyko/8215130/webrev.00/
11-01-2019

> Do you (Oracle?) have any plan to update LCMS? The reporter/assignee does not work for Oracle .. but other than exceptional circumstances, Oracle will only update LCMS when a new release is made and taking a random state of a between releases code base is a recipe for problems. Safe, small, important point fixes that *exactly* correspond to what is pushed upstream can be OK since they won't regress when we do upgrade. In this case I have been assuming the reporter is intending to submit such an update for review, under this bug id. Else we'd need to disable the warnings.
10-01-2019

Do you (Oracle?) have any plan to update LCMS? If not so, I think we can apply this change to avoid warnings.
10-01-2019

As description says the fix is already in the mainline.
09-01-2019

IMHO these warnings should be fixed in mainline. So I think we can avoid them as below: ``` diff -r 488773472a63 make/lib/Awt2dLibraries.gmk --- a/make/lib/Awt2dLibraries.gmk Mon Jan 07 10:21:43 2019 +0100 +++ b/make/lib/Awt2dLibraries.gmk Mon Jan 07 21:09:37 2019 +0900 @@ -385,7 +385,7 @@ libawt/java2d, \ HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \ DISABLED_WARNINGS_gcc := format-nonliteral type-limits \ - misleading-indentation undef unused-function, \ + misleading-indentation undef unused-function cast-function-type, \ DISABLED_WARNINGS_clang := tautological-compare format-nonliteral undef, \ DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \ DISABLED_WARNINGS_microsoft := 4819, \ ```
07-01-2019

This piece of code is there since 2.8 import. So 9,10,11.
10-12-2018

what releases are affected?
10-12-2018