-
Notifications
You must be signed in to change notification settings - Fork 616
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
IlmImf: Fix clang compiler warnings #770
IlmImf: Fix clang compiler warnings #770
Conversation
update_arkellr_master_18jun2020
This allows IlmImf to compile cleanly with clang flags -Wall -Wextra -Werror -Wno-unused-parameter Fixes: ImfOpaqueAttribute.h: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers] const int dataSize() const { return _dataSize; } ImfDwaCompressor.cpp: error: comparison of integers of different signs: 'long' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare] if (cd->planarUncBufferEnd + dstScanlineSize - _planarUncBuffer[UNKNOWN] > _planarUncBufferSize[UNKNOWN] ) ImfMisc.cpp: warning: unused variable 'maxBytesPerLine' [-Wunused-variable] size_t maxBytesPerLine = bytesPerLineTable (header, ImfDeepTiledInputFile.cpp:: error: comparison of integers of different signs: 'Imath_2_5::Int64' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare] if(_tileBuffer->dataSize != sizeOfTile) Signed-off-by: Arkell Rasiah <arasiah@pixsystem.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing these!
Update based on review comments. Signed-off-by: Arkell Rasiah <arasiah@pixsystem.com>
547bf98
to
233cd09
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looking good ~ one last thing - there's a std type for doing bitwise math on pointers - with that fix we should be good :)
Addressing reviewer comment. Signed-off-by: Arkell Rasiah <arasiah@pixsystem.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Have a review.
With these updates I can compile the repo cleanly with clang (Xcode10/11) with
"-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-function"
NB: -Werror = treat all warnings as errors.
Pretty clean now. Could use the above -W flags for the OSX CI.
Fixes:
ImfOpaqueAttribute.h: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]
const int dataSize() const { return _dataSize; }
ImfDwaCompressor.cpp: error: comparison of integers of different signs: 'long' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
if (cd->planarUncBufferEnd + dstScanlineSize - _planarUncBuffer[UNKNOWN] > _planarUncBufferSize[UNKNOWN] )
ImfMisc.cpp: warning: unused variable 'maxBytesPerLine' [-Wunused-variable]
size_t maxBytesPerLine = bytesPerLineTable (header,
ImfDeepTiledInputFile.cpp:: error: comparison of integers of different signs: 'Imath_2_5::Int64' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
if(_tileBuffer->dataSize != sizeOfTile)