Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Conversation

@majetideepak
Copy link

…se builds


SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-strict-aliasing")

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are breaking strict aliasing at
reader-internal.cc:282: uint32_t metadata_len = *reinterpret_cast<uint32_t*>(footer_buffer);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we should be compiling with -fno-strict-aliasing; I think this is considered a best practice in general to avoid odd edge cases, even though it may prevent certain compiler optimizations

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. We can use the __restrict attribute if needed.

@xhochy
Copy link
Member

xhochy commented Jul 5, 2016

But this now essentially means that the code passed as condition to DCHECK will be executed? I'm not sure that this is always wanted, e.g. if there are some costly checks.

@wesm
Copy link
Member

wesm commented Jul 5, 2016

I believe the compiler optimizes the expression away since the result is unused.

@majetideepak
Copy link
Author

Yeah! The compiler will optimize the expression since the result is unused.

while (false) \
parquet::internal::NullLog()
#define DCHECK_GT(val1, val2) \
((void)(val1)); \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put this in a PARQUET_IGNORE_EXPR macro or something to make it more clear?

@xhochy
Copy link
Member

xhochy commented Jul 6, 2016

Only thing I may be worried about is if the compiler manages to optimize the calls to CheckIntegrity away. Otherwise change looks fine.

@majetideepak
Copy link
Author

This is a good point. I just debugged the mem-pool-test in release build and debug build with a break point inside CheckIntegrity. The debug build hit the break point and the release build did not.
So I guess it works for calls to CheckIntegrity as well.

@xhochy
Copy link
Member

xhochy commented Jul 6, 2016

Nice, then a clear +1 from my side.

@wesm
Copy link
Member

wesm commented Jul 6, 2016

+1, thank you

@asfgit asfgit closed this in ec78dd8 Jul 6, 2016
@majetideepak majetideepak deleted the PARQUET-551 branch September 9, 2016 14:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants