Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't downgrade the C++ version #103

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

ellert
Copy link
Contributor

@ellert ellert commented Jan 24, 2023

The cmake configuration adds a compiler flag to set the C++ version to C++11. This happens even if the default C++ version for the GCC compiler version used is higer than C++11. In this case the flag downgrades the version.

Since system libraries and headers can use features compatible with the default C++ version of the default compiler, downgrading the C++ version might make some system libraries incompatible with this setting.

The recent update of googletest in Fedora requires C++ 14. The gcc version in Fedora Rawhide is currently 13.

C++ 17 is the default since GCC 11.
C++ 14 is the default since GCC 6.1.

This PR drops the addition of the -std=c++11 flag if the GCC version is 6.1 or greater. With this change the code can be compiled on Fedora Rawhide without triggering errors:

/usr/include/gtest/internal/gtest-port.h:270:2: error: #error C++ versions less than C++14 are not supported.

The cmake configuration adds a compiler flag to set the C++ version to
C++11. This happens even if the default C++ version for the GCC
compiler version used is higer than C++11. In this case the flag
downgrades the version.

Since system libraries and headers can use features compatible with
the default C++ version of the default compiler, downgrading the C++
version might make some system libraries incompatible with this
setting.

The recent update of googletest in Fedora requires C++ 14.
The gcc version in Fedora Rawhide is currently 13.

C++ 17 is the default since GCC 11.
C++ 14 is the default since GCC 6.1.

This PR drops the addition of the -std=c++11 flag if the GCC version
is 6.1 or greater. With this change the code can be compiled on Fedora
Rawhide without triggering errors:

/usr/include/gtest/internal/gtest-port.h:270:2: error: #error C++
versions less than C++14 are not supported.
@musicinmybrain
Copy link

Thank you for sending this upstream. This is really nicely done.

musicinmybrain added a commit to musicinmybrain/gfal2 that referenced this pull request Jan 25, 2023
The cmake configuration adds a compiler flag to set the C++ version to
C++11. This happens even if the default C++ version for the GCC
compiler version used is higer than C++11. In this case the flag
downgrades the version.

Since system libraries and headers can use features compatible with
the default C++ version of the default compiler, downgrading the C++
version might make some system libraries incompatible with this
setting.

The recent update of googletest in Fedora requires C++ 14.
The gcc version in Fedora Rawhide is currently 13.

C++ 17 is the default since GCC 11.
C++ 14 is the default since GCC 6.1.

This PR drops the addition of the -std=c++11 flag if the GCC version
is 6.1 or greater. With this change the code can be compiled on Fedora
Rawhide without triggering errors:

/usr/include/gtest/internal/gtest-port.h:270:2: error: #error C++
versions less than C++14 are not supported.

The content of this commit and the preceding portion of the commit
message were originally written by Mattias Ellert, @ellert, for
cern-fts/davix in cern-fts/davix#103.
musicinmybrain added a commit to musicinmybrain/gfal2 that referenced this pull request Jan 25, 2023
The cmake configuration adds a compiler flag to set the C++ version to
C++11. This happens even if the default C++ version for the GCC
compiler version used is higer than C++11. In this case the flag
downgrades the version.

Since system libraries and headers can use features compatible with
the default C++ version of the default compiler, downgrading the C++
version might make some system libraries incompatible with this
setting.

The recent update of googletest in Fedora requires C++ 14.
The gcc version in Fedora Rawhide is currently 13.

C++ 17 is the default since GCC 11.
C++ 14 is the default since GCC 6.1.

This PR drops the addition of the -std=c++11 flag if the GCC version
is 6.1 or greater. With this change the code can be compiled on Fedora
Rawhide without triggering errors:

/usr/include/gtest/internal/gtest-port.h:270:2: error: #error C++
versions less than C++14 are not supported.

The content of this commit and the preceding portion of the commit
message were originally written by Mattias Ellert, @ellert, for
cern-fts/davix in cern-fts/davix#103.
musicinmybrain added a commit to musicinmybrain/gfal2 that referenced this pull request Jan 25, 2023
The cmake configuration adds a compiler flag to set the C++ version to
C++11. This happens even if the default C++ version for the GCC
compiler version used is higer than C++11. In this case the flag
downgrades the version.

Since system libraries and headers can use features compatible with
the default C++ version of the default compiler, downgrading the C++
version might make some system libraries incompatible with this
setting.

The recent update of googletest in Fedora requires C++ 14.
The gcc version in Fedora Rawhide is currently 13.

C++ 17 is the default since GCC 11.
C++ 14 is the default since GCC 6.1.

This PR drops the addition of the -std=c++11 flag if the GCC version
is 6.1 or greater. With this change the code can be compiled on Fedora
Rawhide without triggering errors:

/usr/include/gtest/internal/gtest-port.h:270:2: error: #error C++
versions less than C++14 are not supported.

The content of this commit and the preceding portion of the commit
message were originally written by Mattias Ellert, @ellert, for
cern-fts/davix in cern-fts/davix#103.
musicinmybrain added a commit to musicinmybrain/gfal2 that referenced this pull request Jan 25, 2023
The cmake configuration adds a compiler flag to set the C++ version to
C++11. This happens even if the default C++ version for the GCC
compiler version used is higer than C++11. In this case the flag
downgrades the version.

Since system libraries and headers can use features compatible with
the default C++ version of the default compiler, downgrading the C++
version might make some system libraries incompatible with this
setting.

The recent update of googletest in Fedora requires C++ 14.
The gcc version in Fedora Rawhide is currently 13.

C++ 17 is the default since GCC 11.
C++ 14 is the default since GCC 6.1.

This PR drops the addition of the -std=c++11 flag if the GCC version
is 6.1 or greater. With this change the code can be compiled on Fedora
Rawhide without triggering errors:

/usr/include/gtest/internal/gtest-port.h:270:2: error: #error C++
versions less than C++14 are not supported.

The implementation and the preceding commit message text are by Mattias
Ellert, @ellert, copied from cern-fts/davix#103.
@mpatrascoiu mpatrascoiu merged commit de4dd48 into cern-fts:devel Feb 1, 2023
@mpatrascoiu
Copy link
Contributor

Hello,

Thanks for the great fix! Merged into develop.

Cheers,
Mihai

@ellert ellert deleted the dont-downgrade-c++-version branch February 1, 2023 15:21
mpatrascoiu pushed a commit to cern-fts/gfal2 that referenced this pull request Feb 2, 2023
The cmake configuration adds a compiler flag to set the C++ version to
C++11. This happens even if the default C++ version for the GCC
compiler version used is higer than C++11. In this case the flag
downgrades the version.

Since system libraries and headers can use features compatible with
the default C++ version of the default compiler, downgrading the C++
version might make some system libraries incompatible with this
setting.

The recent update of googletest in Fedora requires C++ 14.
The gcc version in Fedora Rawhide is currently 13.

C++ 17 is the default since GCC 11.
C++ 14 is the default since GCC 6.1.

This PR drops the addition of the -std=c++11 flag if the GCC version
is 6.1 or greater. With this change the code can be compiled on Fedora
Rawhide without triggering errors:

/usr/include/gtest/internal/gtest-port.h:270:2: error: #error C++
versions less than C++14 are not supported.

The implementation and the preceding commit message text are by Mattias
Ellert, @ellert, copied from cern-fts/davix#103.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants