Skip to content

Unit tests build fails with GCC 12+ #425

@pet74alex

Description

@pet74alex

I get the following error when building unit tests by GCC 13.1:
clickhouse-cpp/ut/utils_comparison.h: In instantiation of ‘testing::AssertionResult CompareRecursive(const Left&, const Right&) [with Left = char [5]; Right = char [5]]’: clickhouse-cpp/ut/utils_ut.cpp:15:5: required from here clickhouse-cpp/ut/utils_comparison.h:159:18: error: comparison between two arrays [-Werror=array-compare] 159 | if (left != right) { | ~~~~~^~~~~~~~ clickhouse-cpp/ut/utils_comparison.h:159:18: note: use unary ‘+’ which decays operands to pointers or ‘&‘indirect_ref’ not supported by dump_decl<declaration error>[0] != &‘indirect_ref’ not supported by dump_decl<declaration error>[0]’ to compare the addresses

This error detection was added to GCC 12, it can be suppressed by the compiler settings but it would be better to fix the affected code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions