[ https://issues.apache.org/jira/browse/AVRO-3070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17304960#comment-17304960 ]
Mitja P commented on AVRO-3070: ------------------------------- Issue is with `cppcheck` version 1.90 which is installed on docker image `ubuntu:latest`. I get same error if I run it with 1.90. Works fine on 2.1 and later. Haven't tested on 2.0. I think it's better to leave `build.sh` script as is and disable Lint only in github actions. [https://github.com/apache/avro/blob/5be7d16312fb3a0e1ea18c60a04ba0c1e92e1fc0/.github/workflows/test-lang-c%2B%2B.yml#L40] Another solution would be to bump ubuntu version from `ubuntu:latest` to `ubuntu:groovy` which uses version 2.1. > [Build] C++ lint is failing Github Actions > ------------------------------------------ > > Key: AVRO-3070 > URL: https://issues.apache.org/jira/browse/AVRO-3070 > Project: Apache Avro > Issue Type: Task > Reporter: Ryan Skraba > Priority: Major > > It looks like the *{{./build.sh lint}}* command is failing on github actions. > This works on my local build in the docker. > There haven't been any changes to the c++ files since the last success, but I > noticed that the github C compiler versions have bumped from > [7.5.0|https://github.com/apache/avro/runs/2019837703?check_suite_focus=true] > to > [9.3.0|https://github.com/apache/avro/runs/2040426774?check_suite_focus=true]. > {code} > Run ./build.sh lint > CMake Deprecation Warning at CMakeLists.txt:19 (cmake_minimum_required): > Compatibility with CMake < 2.8.12 will be removed from a future version of > CMake. > Update the VERSION argument <min> value or use a ...<max> suffix to tell > CMake that the project does not need compatibility with older versions. > -- The C compiler identification is GNU 9.3.0 > -- The CXX compiler identification is GNU 9.3.0 > -- Detecting C compiler ABI info > -- Detecting C compiler ABI info - done > -- Check for working C compiler: /usr/bin/cc - skipped > -- Detecting C compile features > -- Detecting C compile features - done > -- Detecting CXX compiler ABI info > -- Detecting CXX compiler ABI info - done > -- Check for working CXX compiler: /usr/bin/c++ - skipped > -- Detecting CXX compile features > -- Detecting CXX compile features - done > -- Found Boost: > /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found > suitable version "1.71.0", minimum required is "1.38") found components: > filesystem iostreams program_options regex system > Enabled snappy codec > -- Found Snappy: /usr/lib/x86_64-linux-gnu/libsnappy.so > -- Configuring done > -- Generating done > -- Build files have been written to: > /home/runner/work/avro/avro/lang/c++/build > impl/json/JsonIO.hh:398:64: error: Using pointer to temporary. > [danglingTemporaryLifetime] > out_.writeBytes(reinterpret_cast<const uint8_t*>(s.data()), s.size()); > ^ > impl/json/JsonIO.hh:397:30: note: Assigned to reference. > const std::string& s = oss.str(); > ^ > impl/json/JsonIO.hh:398:58: note: Pointer to container is created here. > out_.writeBytes(reinterpret_cast<const uint8_t*>(s.data()), s.size()); > ^ > impl/json/JsonIO.hh:398:64: note: Using pointer to temporary. > out_.writeBytes(reinterpret_cast<const uint8_t*>(s.data()), s.size()); > ^ > impl/json/JsonIO.hh:415:64: error: Using pointer to temporary. > [danglingTemporaryLifetime] > out_.writeBytes(reinterpret_cast<const uint8_t*>(s.data()), s.size()); > ^ > impl/json/JsonIO.hh:414:30: note: Assigned to reference. > const std::string& s = oss.str(); > ^ > impl/json/JsonIO.hh:415:58: note: Pointer to container is created here. > out_.writeBytes(reinterpret_cast<const uint8_t*>(s.data()), s.size()); > ^ > impl/json/JsonIO.hh:415:64: note: Using pointer to temporary. > out_.writeBytes(reinterpret_cast<const uint8_t*>(s.data()), s.size()); > ^ > Error: Process completed with exit code 1. > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)