Skip to content

Commit

Permalink
[C++] g++ (GCC) 14.2.1 20240910 fails to compile due to -Werror=conve…
Browse files Browse the repository at this point in the history
…rsion (#3166)

* Fix error: conversion from ‘boost::crc_optimal<32, 79764919, 4294967295, 4294967295, true, true>::value_type’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]

* Fix error: ‘find_if’ is not a member of ‘std’;

* Fix error: no matching function for call to ‘find(std::vector<std::__cxx11::basic_string<char> >::const_iterator, std::vector<std::__cxx11::basic_string<char> >::const_iterator, const std::string&)’
  • Loading branch information
hexagonhill authored Sep 23, 2024
1 parent 51e208f commit 2d3029d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lang/c++/impl/DataFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void DataFileWriterBase::sync() {
crc.process_bytes(reinterpret_cast<const char *>(temp.data()),
temp.size());
// For Snappy, add the CRC32 checksum
int32_t checksum = crc();
auto checksum = crc();

// Now compress
size_t compressed_size = snappy::Compress(
Expand Down Expand Up @@ -408,7 +408,7 @@ void DataFileReaderBase::readDataBlock() {
"Snappy Compression reported an error when decompressing");
}
crc.process_bytes(uncompressed.c_str(), uncompressed.size());
uint32_t c = crc();
auto c = crc();
if (checksum != c) {
throw Exception(
"Checksum did not match for Snappy compression: Expected: {}, computed: {}",
Expand Down
1 change: 1 addition & 0 deletions lang/c++/impl/Node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* limitations under the License.
*/

#include <algorithm>
#include <cmath>
#include <unordered_set>

Expand Down
1 change: 1 addition & 0 deletions lang/c++/impl/parsing/Symbol.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef avro_parsing_Symbol_hh__
#define avro_parsing_Symbol_hh__

#include <algorithm>
#include <map>
#include <set>
#include <sstream>
Expand Down

0 comments on commit 2d3029d

Please sign in to comment.