From 2bbb5a0def63278c3fbe239777ab3cd1de5509ec Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Sun, 4 Feb 2024 16:05:03 -0500 Subject: [PATCH] Fix build with GCC 14 --- gcc14.patch | 34 ++++++++++++++++++++++++++++++++++ openexr.spec | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 gcc14.patch diff --git a/gcc14.patch b/gcc14.patch new file mode 100644 index 0000000..8a95062 --- /dev/null +++ b/gcc14.patch @@ -0,0 +1,34 @@ +src/lib/OpenEXRCore/internal_zip.c: In function ‘apply_zip_impl’: +src/lib/OpenEXRCore/internal_zip.c:365:21: error: passing argument 2 of ‘compress2’ from incompatible pointer type [-Wincompatible-pointer-types] +/usr/include/zlib.h:1229:69: note: expected ‘long unsigned int *’ but argument is of type ‘size_t *’ {aka ‘unsigned int *’} + +src/lib/OpenEXRCore/internal_dwa_compressor.h: In function ‘exr_compress_buffer’: +src/lib/OpenEXRCore/internal_dwa_compressor.h:57:21: error: passing argument 2 of ‘compress2’ from incompatible pointer type [-Wincompatible-pointer-types] +/usr/include/zlib.h:1229:69: note: expected ‘long unsigned int *’ but argument is of type ‘size_t *’ {aka ‘unsigned int *’} + +diff --git a/src/lib/OpenEXRCore/internal_dwa_compressor.h b/src/lib/OpenEXRCore/internal_dwa_compressor.h +index e1d55336..0ee98d63 100644 +--- a/src/lib/OpenEXRCore/internal_dwa_compressor.h ++++ b/src/lib/OpenEXRCore/internal_dwa_compressor.h +@@ -54,7 +54,7 @@ static exr_result_t exr_compress_buffer ( + compbufsz = out_bytes_avail; + if (Z_OK != compress2 ( + (Bytef*) out, +- &compbufsz, ++ (uLongf *) &compbufsz, + (const Bytef*) in, + (uLong) in_bytes, + level)) +diff --git a/src/lib/OpenEXRCore/internal_zip.c b/src/lib/OpenEXRCore/internal_zip.c +index f3980aee..820fd673 100644 +--- a/src/lib/OpenEXRCore/internal_zip.c ++++ b/src/lib/OpenEXRCore/internal_zip.c +@@ -362,7 +362,7 @@ apply_zip_impl (exr_encode_pipeline_t* encode) + compbufsz = encode->compressed_alloc_size; + if (Z_OK != compress2 ( + (Bytef*) encode->compressed_buffer, +- &compbufsz, ++ (uLongf *) &compbufsz, + (const Bytef*) encode->scratch_buffer_1, + (uLong) encode->packed_bytes, + level)) diff --git a/openexr.spec b/openexr.spec index 2b2c2fc..9942afb 100644 --- a/openexr.spec +++ b/openexr.spec @@ -13,6 +13,8 @@ Source0: https://github.com/AcademySoftwareFoundation/%{name}/archive/v%{ Patch0: openexr-cstdint.patch # https://github.com/AcademySoftwareFoundation/openexr/pull/1507 Patch1: march-x86-64-v3.patch +# Fix incompatible pointer types with GCC 14 on i686 +Patch2: gcc14.patch BuildRequires: cmake gcc gcc-c++ BuildRequires: boost-devel