This is an automated email from the ASF dual-hosted git repository.
jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new 68ff1d965e icc: fix SampleICC enum-constexpr error on Clang 16+
(icMaxEnumGeometry)
68ff1d965e is described below
commit 68ff1d965e4073084f7c97bf0e570ce24c2f71dd
Author: Jim Jagielski <[email protected]>
AuthorDate: Thu Jun 11 17:55:20 2026 -0400
icc: fix SampleICC enum-constexpr error on Clang 16+ (icMaxEnumGeometry)
Building icc fails compiling IccUtil.cpp on a modern (Clang 16+) toolchain:
IccUtil.cpp:1303: error: integer value 4294967295 is outside the valid
range of values [0, 3] for the enumeration type 'icMeasurementGeometry'
[-Wenum-constexpr-conversion]
SampleICC declares out-of-range sentinels as
#define icMaxEnumGeometry ((icMeasurementGeometry) 0xFFFFFFFF)
and then uses them in 'case' labels. Casting 0xFFFFFFFF to an enum whose
values only span 0..2 in a constant expression is a hard error as of
Clang 16 (-Wenum-constexpr-conversion is on by default, independent of
-Werror), so the build stops there.
The in-tree SampleICC-1.3.2.patch already fixes the parallel
icMeasurementFlare
enum by turning its sentinel into an in-enum enumerator (icMaxEnumFlare =
0xFFFFFFFF), which extends the enum's value range so the constant is in
range.
It just missed icMaxEnumGeometry -- the only other sentinel used in a case
label. Apply the identical treatment to icMeasurementGeometry.
Verified the full patch chain applies to a pristine SampleICC-1.3.2 tarball
with icProfileHeader.h patching cleanly and the enum gaining the enumerator.
---
main/icc/SampleICC-1.3.2.patch | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/main/icc/SampleICC-1.3.2.patch b/main/icc/SampleICC-1.3.2.patch
index d8d205c70b..c76134967b 100644
--- a/main/icc/SampleICC-1.3.2.patch
+++ b/main/icc/SampleICC-1.3.2.patch
@@ -3108,6 +3108,19 @@
#define icMaxFlare ((icMeasurementFlare) 0xFFFFFFFF) /* as defined by
earlier versions */
+@@ -672,10 +673,11 @@
+ icGeometryUnknown = 0x00000000, /* Unknown geometry */
+ icGeometry045or450 = 0x00000001, /* 0/45, 45/0 */
+ icGeometry0dord0 = 0x00000002, /* 0/d or d/0 */
++ icMaxEnumGeometry = 0xFFFFFFFF
+ } icMeasurementGeometry;
+
+ /** Convenience Enum Definition - Not defined in ICC specification*/
+-#define icMaxEnumGeometry ((icMeasurementGeometry) 0xFFFFFFFF)
++/*#define icMaxEnumGeometry ((icMeasurementGeometry) 0xFFFFFFFF)*/
+ #define icMaxGeometry ((icMeasurementGeometry) 0xFFFFFFFF)
+
+
--- misc/SampleICC-1.3.2/Tools/CmdLine/Makefile.in Mon Aug 20 22:10:42 2007
+++ misc/build/SampleICC-1.3.2/Tools/CmdLine/Makefile.in Fri Jan 25
14:23:09 2008
@@ -101,17 +101,13 @@