Skip to content

g++ 15.1.1 compile warning "<ciso646> is deprecated in C++17 #421

Open

Description

@ZCKevin-TW

Hi, I just updated my compiler to gcc version 15.1.1 20250425 (GCC).
When I compiled my project, I encountered

[build] FAILED: external/clickhouse-cpp/contrib/absl/absl/CMakeFiles/absl_int128.dir/numeric/int128.cc.o 
[build] /usr/bin/g++  -Ixxx/external/clickhouse-cpp/contrib/absl -pthread -Wall -Wextra -Werror -Wno-deprecated-declarations -g -std=gnu++17 -MD -MT external/clickhouse-cpp/contrib/absl/absl/CMakeFiles/absl_int128.dir/numeric/int128.cc.o -MF external/clickhouse-cpp/contrib/absl/absl/CMakeFiles/absl_int128.dir/numeric/int128.cc.o.d -o external/clickhouse-cpp/contrib/absl/absl/CMakeFiles/absl_int128.dir/numeric/int128.cc.o -c /xxx/external/clickhouse-cpp/contrib/absl/absl/numeric/int128.cc
[build] In file included from /xxx/external/clickhouse-cpp/contrib/absl/absl/base/options.h:73,
[build]                  from /xxx/external/clickhouse-cpp/contrib/absl/absl/base/config.h:66,
[build]                  from /xxx/external/clickhouse-cpp/contrib/absl/absl/numeric/int128.h:33,
[build]                  from /xxx/external/clickhouse-cpp/contrib/absl/absl/numeric/int128.cc:15:
[build] /usr/include/c++/15.1.1/ciso646:46:4: error: #warning "<ciso646> is deprecated in C++17, use <version> to detect implementation-specific macros" [-Werror=cpp]
[build]    46 | #  warning "<ciso646> is deprecated in C++17, use <version> to detect implementation-specific macros"
[build]       |
...

Is it safe to ignore this warning?

Activity

  1. RoyBellingan commented on Sep 2, 2026

    @RoyBellingan
    Contributor

    Yes is just a minor nitpick, and I tough was from c++20! (#561)

  2. polyglotAI-bot commented on Nov 18, 2026

    @polyglotAI-bot
    Collaborator

    Recommendation: Keep open — fix needed
    PR #561 (merged, not released yet) removes the <ciso646> include only for C++20 builds, but the library builds as C++17 with -Werror, so by the code the GCC 15 build of the bundled Abseil still fails on master. Next step: extend the guard in contrib/absl/absl/base/options.h to C++17 (for example, include <version> when __has_include(<version>) is true), and add GCC 15 to the CI matrix, which stops at gcc-14 (.github/workflows/linux.yml:27).

    Analysis: contrib/absl/absl/base/options.h:73-77 includes <version> only when __cplusplus >= 202002L (PR #561), else <ciso646>. The library sets C++17 (cmake/cpp17.cmake:5, called at CMakeLists.txt:58) and adds -Wall -Wextra -Werror to CMAKE_CXX_FLAGS (CMakeLists.txt:76); these flags also apply to the bundled Abseil targets. In GCC 15.1, <ciso646> emits #warning "<ciso646> is deprecated in C++17 …" when __cplusplus >= 201703L && defined __DEPRECATED (libstdc++ include/c_global/ciso646), and -Werror makes it the error in the issue log. The warning itself is harmless: in C++ <ciso646> is empty, and Abseil includes it only to identify the standard library. A build with -DCH_USE_ABSEIL_FOR_BIGNUM=OFF (the 3.x Int128) does not build the bundled Abseil, and no object of that build includes <ciso646>.

    Code check: commands and output
    # Flags of the bundled Abseil target in the default build
    ninja -C build -t commands contrib/absl/absl/CMakeFiles/absl_int128.dir/numeric/int128.cc.o | tail -1
    # The header that options.h includes, in C++17 and C++20 mode
    for std in gnu++17 c++20; do echo "== -std=$std"; g++ -std=$std -Icontrib/absl -H -fsyntax-only contrib/absl/absl/numeric/int128.cc 2>&1 | grep -E "^\.+ .*(ciso646|/version)$"; done
    # Objects that include <ciso646>: default build, and a build with -DCH_USE_ABSEIL_FOR_BIGNUM=OFF
    ninja -C build -t deps | grep -c "/ciso646$"
    ninja -C build-noabsl -t deps | grep -c "/ciso646$"

    Output on master (58453c2), GCC 13.3.0 and clang 18:

    /usr/bin/clang++ -DWITH_OPENSSL=1 -I…/contrib/absl -pthread -Wall -Wextra -Werror -Wno-deprecated-declarations -O3 -DNDEBUG -std=gnu++17 -MD -MT contrib/absl/absl/CMakeFiles/absl_int128.dir/numeric/int128.cc.o -MF … -o … -c …/contrib/absl/absl/numeric/int128.cc
    == -std=gnu++17
    .... /usr/include/c++/13/ciso646
    == -std=c++20
    .... /usr/include/c++/13/version
    31
    0
    

    Automated triage by Polyglot AI. A maintainer makes the final decision.

  3. added
    bugSomething isn't working
    platform-supportSome plaftorm (or platform/compiler/libs combination) is not properly supported
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingplatform-supportSome plaftorm (or platform/compiler/libs combination) is not properly supportedquestionFurther information is requested

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions