Skip to content

Build issue with clang6 #13

@adriaandegroot

Description

@adriaandegroot

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;
+ };
+ 
+ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions