mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 05:16:00 +03:00
[GH-ISSUE #2179] Consider requiring C++11 #1107
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#1107
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gaul on GitHub (May 31, 2023).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2179
Currently s3fs only relies on C++03 which gives it compatibility with ancient Linux distros. Upgrading to C++11 would allow
optional,span,unique_ptr,unordered_map, and some modest syntactic sugar. A bigger benefit is moving closer to compatibility with the AWS SDK (C++14) in #1068. Recently brought up in #2177.@ggtakec commented on GitHub (Jun 10, 2023):
If we don't have (or very few) environments that still have to rely on C++03, then I think it's fine to proceed with the migration to C++11.
(Because I have not been able to grasp the affected users and environments that depend on C++03, I would like to know that.)
Regarding the
AWS SDK(CPP), we should consider the license of s3fs, how to link it, etc.The only thing you want to incorporate into s3fs is around authentication, right?
(It has the same function as the library created at https://github.com/ggtakec/s3fs-fuse-awscred-lib, so it is easy to code and embed)
@ggtakec commented on GitHub (Jun 20, 2023):
@gaul
During the regular build last weekend, SUSE's cppcheck has an error because cppcheck has been upgraded to 2.10.
Most of the errors say we should use the std's algorithm.
For checking the condition that it must be C++03 currenty, I tried to test using C++11(lambda function) as a trial.
As a result, only CentOS7 failed and other OSs(specified by GithubActions of the current s3fs) succeeded.
If we drop C++03 support(it means stop CentOS7 support), I can PR the current code, but if we still want to continue C++03 support, I create a PR after changing the code.
Given this situation, I think we can move to C++11.
@gaul commented on GitHub (Jun 23, 2023):
RHEL7 includes GCC 4.8.x which has strong C++11 support so I think we can use most features: https://gcc.gnu.org/projects/cxx-status.html#cxx11. I think the error you encountered might just be some configuration needed, e.g., specify
-std=c++11. Note that there are a bunch of other library changes that newer libstdc++ might accidentally expose in C++11 mode.I prefer to use C++11 or newer since features like
unique_ptrmake it easier to write correct code but more importantly writing modern C++ makes it easier for contributors. If there is some backwards compatibility issue I think we can drop support for that distro or they can use a non-standard compiler on that distro.The cppcheck error is confusing and maybe some false positive. I tried to look into this on my Fedora 38 desktop but compiling cppcheck has become more complicated and even Red Hat is having trouble packaging it: https://bugzilla.redhat.com/show_bug.cgi?id=2165211. Maybe it is just easier to disable newer cppcheck on a few CI runners for now?
@gaul commented on GitHub (Jul 31, 2023):
1.93 will require C++11.