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

[C++] Clear up various warnings on linux/windows, add support for warnings as error #440

Merged
merged 3 commits into from
Nov 28, 2017

Conversation

cesaref
Copy link
Contributor

@cesaref cesaref commented Nov 27, 2017

Concentrating on the C++ client and it's tests, i've tidied up various warnings from the windows build. The majority of these relate to 64->32 bit conversions which are warning on this build (but not with the osx/linux builds).

The build for me now builds the linux/osx client with only warnings from the included hdr_histogram project - i've submitted a pull to resolve those warnings with that which would allow the library to be warning free.

The most controversial change will probably be to the AtomicBuffer (and related Mock) where i've modified the length parameters to be size_t (so the constructor, capacity, wrap methods). I've left m_left data_type alone, and the corresponding get/set methods which take an offset, and the bounds checks still enforce that buffers fit within util::index_t. The tests that were causing warnings are now using convertSizeToIndex() which appears to do what it says on the tin, and looks to be better than casting.

I've modified the cppbuild/cppbuild script to add extra command line arguments. This now means you can build the media driver with cppbuild/cppbuild --build-aeron-driver for example, and can you enable the C or C++ warnings as errors with appropriate command line arguments. --help gives an overview of these.

@tmontgomery tmontgomery merged commit 392456f into aeron-io:master Nov 28, 2017
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

Successfully merging this pull request may close these issues.

2 participants