From d90db28b2a4c09b35f8e95caaa41042bc3a0c456 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Sun, 4 Jan 2026 11:21:47 +0100 Subject: [PATCH 1/3] [modules] Remove headers deprecated in C++17 from the module maps Remove the headers `ccomplex`, `cstdalign`, `cstdbool`, and `ctgmath` from the module maps. They are deprecated since C++17 and should not be included anymore by ROOT or its users, as C++17 is the minimum supported C++ standard. This fixes build warnings that can be seen in the CI when building with GCC 15, for example on Fedora 42: ```txt [ 47%] Generating G__Core.cxx, ../lib/Core.pcm While building module 'Core': While building module 'std' imported from input_line_1:1: In file included from :5: /usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/ccomplex:51:4: warning: " is deprecated in C++17, use instead" [-W#warnings] # warning " is deprecated in C++17, use instead" ^ While building module 'Core': While building module 'std' imported from input_line_1:1: In file included from :23: /usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/cstdalign:50:6: warning: " is deprecated in C++17, remove the #include" [-W#warnings] # warning " is deprecated in C++17, remove the #include" ^ While building module 'Core': While building module 'std' imported from input_line_1:1: In file included from :25: /usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/cstdbool:50:6: warning: " is deprecated in C++17, remove the #include" [-W#warnings] # warning " is deprecated in C++17, remove the #include" ^ While building module 'Core': While building module 'std' imported from input_line_1:1: In file included from :30: /usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/ctgmath:50:6: warning: " is deprecated in C++17, use or instead" [-W#warnings] # warning " is deprecated in C++17, use or instead" ``` --- cmake/unix/makepchinput.py | 5 +---- interpreter/cling/include/cling/std.modulemap | 16 ---------------- .../cling/include/cling/std_msvc.modulemap | 16 ---------------- 3 files changed, 1 insertion(+), 36 deletions(-) diff --git a/cmake/unix/makepchinput.py b/cmake/unix/makepchinput.py index 5e1843a0c8b40..495171eda755c 100755 --- a/cmake/unix/makepchinput.py +++ b/cmake/unix/makepchinput.py @@ -130,10 +130,7 @@ def getSTLIncludes(): "future", "condition_variable", "ciso646", - "ccomplex", - "ctgmath", - "regex", - "cstdbool") + "regex") allHeadersPartContent = "// STL headers\n" diff --git a/interpreter/cling/include/cling/std.modulemap b/interpreter/cling/include/cling/std.modulemap index 9792c71251364..2ff3c67f3d341 100644 --- a/interpreter/cling/include/cling/std.modulemap +++ b/interpreter/cling/include/cling/std.modulemap @@ -19,10 +19,6 @@ module "std" [system] { header "bitset" } // no module for cassert to stay consistent with the OS X modulemap - module "ccomplex" { - export * - header "ccomplex" - } module "cctype" { export * header "cctype" @@ -93,18 +89,10 @@ module "std" [system] { export * header "csignal" } - module "cstdalign" { - export * - header "cstdalign" - } module "cstdarg" { export * header "cstdarg" } - module "cstdbool" { - export * - header "cstdbool" - } module "cstddef" { export * header "cstddef" @@ -132,10 +120,6 @@ module "std" [system] { export * header "cstring" } - module "ctgmath" { - export * - header "ctgmath" - } module "ctime" { export * header "ctime" diff --git a/interpreter/cling/include/cling/std_msvc.modulemap b/interpreter/cling/include/cling/std_msvc.modulemap index 2dff2bc04d657..80c28f4983111 100644 --- a/interpreter/cling/include/cling/std_msvc.modulemap +++ b/interpreter/cling/include/cling/std_msvc.modulemap @@ -32,10 +32,6 @@ module "std" [system] { export * header "cassert" } - module "ccomplex" { - export * - header "ccomplex" - } module "cctype" { export * header "cctype" @@ -117,18 +113,10 @@ module "std" [system] { export * header "csignal" } - module "cstdalign" { - export * - header "cstdalign" - } module "cstdarg" { export * header "cstdarg" } - module "cstdbool" { - export * - header "cstdbool" - } module "cstddef" { export * header "cstddef" @@ -149,10 +137,6 @@ module "std" [system] { export * header "cstring" } - module "ctgmath" { - export * - header "ctgmath" - } module "ctime" { export * header "ctime" From c69d67b8b0e19e09065f4aaa091dd424b33fe109 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Sun, 4 Jan 2026 11:31:43 +0100 Subject: [PATCH 2/3] Format code of `getSTLIncludes()` function in makepchinput.py This is done to make the ruff linter happy. --- cmake/unix/makepchinput.py | 214 +++++++++++++++++++------------------ 1 file changed, 110 insertions(+), 104 deletions(-) diff --git a/cmake/unix/makepchinput.py b/cmake/unix/makepchinput.py index 495171eda755c..ce04c0c7b014b 100755 --- a/cmake/unix/makepchinput.py +++ b/cmake/unix/makepchinput.py @@ -52,110 +52,116 @@ def getGuardedStlInclude(headerName): #------------------------------------------------------------------------------- def getSTLIncludes(): - """ - Here we include the list of c++11 stl headers - From http://en.cppreference.com/w/cpp/header - valarray is removed because it causes lots of compilation at startup. - """ - stlHeadersList = ("cstdlib", - "csignal", - "csetjmp", - "cstdarg", - "typeinfo", - "typeindex", - "type_traits", - "bitset", - "functional", - "utility", - "ctime", - "chrono", - "cstddef", - "initializer_list", - "tuple", - "new", - "memory", - "scoped_allocator", - "climits", - "cfloat", - "cstdint", - "cinttypes", - "limits", - "exception", - "stdexcept", - "cassert", - "system_error", - "cerrno", - "cctype", - "cwctype", - "cstring", - "cwchar", - "cuchar", - "string", - "array", - "vector", - "deque", - "list", - "forward_list", - "set", - "map", - "unordered_set", - "unordered_map", - "stack", - "queue", - "algorithm", - "iterator", - "cmath", - "complex", -# "valarray", - "random", - "numeric", - "ratio", - "cfenv", - "iosfwd", - "ios", - "istream", - "ostream", - "iostream", - "fstream", - "sstream", - "iomanip", - "streambuf", - "cstdio", - "locale", - "clocale", - "codecvt", - "atomic", - "thread", - "mutex", - "future", - "condition_variable", - "ciso646", - "regex") - - allHeadersPartContent = "// STL headers\n" - - for header in stlHeadersList: - allHeadersPartContent += getGuardedStlInclude(header) - - # Special case for regex - allHeadersPartContent += '// treat regex separately\n' +\ - '#if __has_include("regex") && !defined __APPLE__\n' +\ - '#include \n' +\ - '#endif\n' - - # treat this deprecated headers in a special way - stlDeprecatedHeadersList=["strstream"] - allHeadersPartContent += '// STL Deprecated headers\n' +\ - '#define _BACKWARD_BACKWARD_WARNING_H\n' +\ - "#pragma clang diagnostic push\n" +\ - '#pragma GCC diagnostic ignored "-Wdeprecated"\n' - - for header in stlDeprecatedHeadersList: - allHeadersPartContent += getGuardedStlInclude(header) - - allHeadersPartContent += '#pragma clang diagnostic pop\n' +\ - '#undef _BACKWARD_BACKWARD_WARNING_H\n' - return allHeadersPartContent + """ + Here we include the list of c++11 stl headers + From http://en.cppreference.com/w/cpp/header + valarray is removed because it causes lots of compilation at startup. + """ + stlHeadersList = ( + "cstdlib", + "csignal", + "csetjmp", + "cstdarg", + "typeinfo", + "typeindex", + "type_traits", + "bitset", + "functional", + "utility", + "ctime", + "chrono", + "cstddef", + "initializer_list", + "tuple", + "new", + "memory", + "scoped_allocator", + "climits", + "cfloat", + "cstdint", + "cinttypes", + "limits", + "exception", + "stdexcept", + "cassert", + "system_error", + "cerrno", + "cctype", + "cwctype", + "cstring", + "cwchar", + "cuchar", + "string", + "array", + "vector", + "deque", + "list", + "forward_list", + "set", + "map", + "unordered_set", + "unordered_map", + "stack", + "queue", + "algorithm", + "iterator", + "cmath", + "complex", + # "valarray", + "random", + "numeric", + "ratio", + "cfenv", + "iosfwd", + "ios", + "istream", + "ostream", + "iostream", + "fstream", + "sstream", + "iomanip", + "streambuf", + "cstdio", + "locale", + "clocale", + "codecvt", + "atomic", + "thread", + "mutex", + "future", + "condition_variable", + "ciso646", + "regex", + ) + + allHeadersPartContent = "// STL headers\n" + + for header in stlHeadersList: + allHeadersPartContent += getGuardedStlInclude(header) + + # Special case for regex + allHeadersPartContent += ( + "// treat regex separately\n" + + '#if __has_include("regex") && !defined __APPLE__\n' + + "#include \n" + + "#endif\n" + ) + + # treat this deprecated headers in a special way + stlDeprecatedHeadersList = ["strstream"] + allHeadersPartContent += ( + "// STL Deprecated headers\n" + + "#define _BACKWARD_BACKWARD_WARNING_H\n" + + "#pragma clang diagnostic push\n" + + '#pragma GCC diagnostic ignored "-Wdeprecated"\n' + ) + + for header in stlDeprecatedHeadersList: + allHeadersPartContent += getGuardedStlInclude(header) + + allHeadersPartContent += "#pragma clang diagnostic pop\n" + "#undef _BACKWARD_BACKWARD_WARNING_H\n" + return allHeadersPartContent + #------------------------------------------------------------------------------- def getExtraIncludes(headers): From 37ee619cd960fa9ee048d3bf54ebf79a7601f460 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Fri, 9 Jan 2026 17:21:10 +0100 Subject: [PATCH 3/3] [modules] Remove `ciso646` from the module maps - non standard in C++20 Remove the `ciso646` header from the module maps. It is not part of the C++20 standard, and should not be included anymore by ROOT or its users if they compile ROOT with C++20 or higher. Note that also higher C++ versions will also define the `cplusplus20` variable, as newer standards always define all previous versions. This fixes build warnings that can be seen in the CI when building with GCC 15, for example on Fedora 42: ```txt While building module 'Core': While building module 'std' imported from input_line_1:1: In file included from :12: /usr/lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/ciso646:49:6: warning: " is not a standard header since C++20, use to detect implementation-specific macros" [-W#warnings] # warning " is not a standard header since C++20, use to detect implementation-specific macros" ``` --- interpreter/cling/include/cling/std.modulemap | 1 + interpreter/cling/include/cling/std_msvc.modulemap | 1 + 2 files changed, 2 insertions(+) diff --git a/interpreter/cling/include/cling/std.modulemap b/interpreter/cling/include/cling/std.modulemap index 2ff3c67f3d341..2db4cc7c82181 100644 --- a/interpreter/cling/include/cling/std.modulemap +++ b/interpreter/cling/include/cling/std.modulemap @@ -44,6 +44,7 @@ module "std" [system] { header "cinttypes" } module "ciso646" { + requires !cplusplus20 export * header "ciso646" } diff --git a/interpreter/cling/include/cling/std_msvc.modulemap b/interpreter/cling/include/cling/std_msvc.modulemap index 80c28f4983111..899aaf40856d3 100644 --- a/interpreter/cling/include/cling/std_msvc.modulemap +++ b/interpreter/cling/include/cling/std_msvc.modulemap @@ -68,6 +68,7 @@ module "std" [system] { header "cinttypes" } module "ciso646" { + requires !cplusplus20 export * header "ciso646" }