syoyo / tinyexr

Tiny OpenEXR image loader/saver library
710 stars 139 forks source link

Not compiling on macOS with clang 18.1.8 #209

Closed fknfilewalker closed 3 months ago

fknfilewalker commented 3 months ago

Similar to #208 the clang compiler flags prohibit compilation. I am using clang 18.1.8 on macOS.

e.g.,

tinyexr.h:829:3: error: unsafe buffer access [-Werror,-Wunsafe-buffer-usage]
[build]   829 |   dst[1] = src[1];

Again, either we remove these flags or fix the code.

syoyo commented 3 months ago

It is an well-known? false positive behavior of -Wunsafe-buffer-usage for clang-17+

https://github.com/lighttransport/tinyusdz/blob/07f05cad0400234497ddd4a5e242c73b8d3e99aa/CMakeLists.txt#L687

You can do some thing like this as a work around. PR is much appreciated!