Skip to content

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

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. added
    question
    on Jul 21, 2025
  2. RoyBellingan commented on Sep 2, 2026

    @RoyBellingan
    Contributor

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

  3. 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. The CI matrix stops at gcc-14 (.github/workflows/linux.yml:27).

    Analysis: contrib/absl/absl/base/options.h:73-77 includes <version> only when __cplusplus >= 202002L, else <ciso646>; the library sets C++17 (cmake/cpp17.cmake:5) and adds -Wall -Wextra -Werror to CMAKE_CXX_FLAGS (CMakeLists.txt:76), and these flags also apply to the bundled Abseil. In GCC 15.1, <ciso646> emits a deprecation #warning in C++17 mode (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.

    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. Shortened on 2026-11-20: the edit history has the first version.

  4. added
    bug
    platform-support
    on Nov 18, 2026
  5. added
    environment
    on Nov 19, 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

    bugenvironmentplatform-supportquestion

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions