-
Notifications
You must be signed in to change notification settings - Fork 579
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
Set minimum supported version of Clang to 17 #4528
Conversation
caa293f
to
3ca1c65
Compare
3ca1c65
to
3113b24
Compare
3113b24
to
353dc8d
Compare
Clang didn't implement WG21 P0634R3 until Clang 16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All for it, but what about semver guarantees?
// TODO: C++20 introduces std::source_location which will allow to eliminate this | ||
// macro altogether. Instead, using code would just call the C++ function | ||
// that makes use of std::source_location like so: | ||
// | ||
// template<typename T, uint32_t M, typename F> | ||
// int botan_ffi_visit(botan_struct<T, M>* obj, F func, | ||
// const std::source_location sl = std::source_location::current()) | ||
// { | ||
// // [...] | ||
// if constexpr(...) | ||
// { | ||
// return ffi_guard_thunk(sl.function_name(), [&] { return func(*p); }) | ||
// } | ||
// // [...] | ||
// } | ||
#define BOTAN_FFI_VISIT(obj, lambda) botan_ffi_visit(obj, lambda, __func__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
Personally I view SemVer and the minimum supported compiler version as distinct issues. Admittedly this is not spelled out so concretely, only alluded to in statements in the docs like
In retrospect specifying the minimum Clang version in 3.0.0 rather than floating it like XCode/NDK was a mistake, since it was known at the time that Clang was well behind on C++20 features. Alas. I can't find many comparable situations wrt required toolchain updates. C is pretty stagnant so it doesn't come up much. In Rust you just bump the minor version. Apps like Chrome do this (I guess they just recently started requiring Clang 16) but it's not quite the same situation as for a library that has direct downstream consumers. For context main motivation here is that with a bit of work we can capture the location of all exception throws with Maybe not worth it though. |
That's exactly my concern.
I believe
Newer compiler is always worth it, in my personal opinion. Though, I feel we did upset some users with the jump to C++20 (most notable the automobile industry that is bound to MISRA, and thus C++17). |
I love how MISRA, focused on avoiding runtime errors in the code, decided to standardize on the version of C++ that doesn't have You do have a point. I've been thinking for Botan4 if it makes sense to drop deprecated features and possibly bump compiler versions (eg GCC 13/Clang 17 so we finally have |
Full ack on the above. @Ashishbsharma has a point. Let's explore making the newer compilers a soft dependency, hide a compiler switch behind the existing macros, and start using source_location where we can. I'm not sure it would buy us much benefit aside of getting some experience with the new features though, admittedly. |
Honestly it seems like it would be simpler at that point to just continue using the traditional At this point my thinking is maybe I should revert #4530, close this and just accept we're stuck with Clang 14 for the duration. This conversation does get me thinking about the timing of Botan4. The previous logic of ~~ 2027 was based around the pipeline
None of this is relevant if we just stick with C++20 for Botan4, the compilers in 24.04 are more than enough. So we could do something more like early 2026? IDK |
Closing as wont-do. We'll just wait for Botan4 and at time time fix new minimum compiler versions |
#4529