Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issue with clang6 #13

Open
adriaandegroot opened this issue Jun 23, 2018 · 0 comments
Open

Build issue with clang6 #13

adriaandegroot opened this issue Jun 23, 2018 · 0 comments

Comments

@adriaandegroot
Copy link

struct scanLineHeader in aces_formatter.cpp uses int32 for its fields, but is initialized with uint32 values. This causes build failures with strict C++ compilers (Clang6 defaults to C++17, I think). Error message is:

aces_formatter.cpp:255:24: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int32' (aka 'int') in initializer list [-Wc++11-narrowing]
        scanLineHeader sh = { yMin + row, scanLineSize };

This patch silences the build error, but I can't really tell if it's correct -- it would seem to me that coordinate and size are both unsigned by nature.

+--- aces_formatter.cpp.orig    2018-06-23 19:34:29 UTC
++++ aces_formatter.cpp
+@@ -107,8 +107,8 @@
+ #include <cassert>
+ 
+ struct scanLineHeader {
+-      int32   yCoordinate;
+-      int32   pixelDataSize;
++      uint32  yCoordinate;
++      uint32  pixelDataSize;
+ };
+ 
+ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant