[C++] Clear up various warnings on linux/windows, add support for warnings as error #440
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.