GCC defined(__cplusplus) one rawhide

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I just want check, if I'm thinking correctly before submitting a fix in
gtest package 

The problem is on Rawhide I have this warning that make other packages
fail to build [1] 

gtest source [2] source get __cplusplus value and include <version> or
#include <ciso646>  depending on __cplusplus value .

On rawhide I got the warning on Fedora 41 don't but __cplusplus of GCC
compiler is the same (201703)

My proposal is to change the comparison from 202002L to 201703L 
-#if GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L && \
+#if GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L && \

What do you think ? 

Best regards, 

[1]
/usr/include/c++/15/ciso646:46:4: warning: #warning "<ciso646> is
deprecated in C++17, use <version> to detect implementation-specific
macros" [-Wcpp]                 
        46 | #  warning "<ciso646> is deprecated in C++17, use
<version> to detect implementation-specific macros"
           |    ^~~~~~~

[2]
https://github.com/google/googletest/blob/main/googletest/include/gtest/internal/gtest-port.h#L274

// Detect C++ feature test macros as gracefully as possible.
// MSVC >= 19.15, Clang >= 3.4.1, and GCC >= 4.1.2 support feature test macros.
#if GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L && \
    (!defined(__has_include) || GTEST_INTERNAL_HAS_INCLUDE(<version>))
#include <version>  // C++20 and later
#elif (!defined(__has_include) || GTEST_INTERNAL_HAS_INCLUDE(<ciso646>))
#include <ciso646>  // Pre-C++20
#endif

[3]
#include <iostream>

int main() {
    std::cout << "__cplusplus: " << __cplusplus << std::endl;
    return 0;
}

g++ check_cpp_version.cpp -o check_cpp_version && ./check_cpp_version
__cplusplus: 201703



-- 
Sérgio M. B.
-- 
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux