-
Notifications
You must be signed in to change notification settings - Fork 219
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
A lot of code assumes that string_view::iterator
is const char*
. Does not work on every compiler
#2323
Comments
hzeller
added a commit
to hzeller/verible
that referenced
this issue
Jan 12, 2025
There were a few assumptions in the code that these types are equivalent, but they are not on all platforms. The fixes sometimes involve ugly `&*some_iterator` constructs to get to the underlying location. Some of these should be re-considered after switching to c++20. Issues: chipsalliance#2323
hzeller
added a commit
to hzeller/verible
that referenced
this issue
Jan 12, 2025
There were a few assumptions in the code that these types are equivalent, but they are not on all platforms. The fixes sometimes involve ugly `&*some_iterator` constructs to get to the underlying location. Some of these should be re-considered after switching to c++20. Issues: chipsalliance#2323
hzeller
added a commit
to hzeller/verible
that referenced
this issue
Jan 12, 2025
There were a few assumptions in the code that these types are equivalent, but they are not on all platforms. The fixes sometimes involve ugly `&*some_iterator` constructs to get to the underlying location. Some of these should be re-considered after switching to c++20. Issues: chipsalliance#2323
hzeller
added a commit
to hzeller/verible
that referenced
this issue
Jan 12, 2025
There were a few assumptions in the code that these types are equivalent, but they are not on all platforms. The fixes sometimes involve ugly `&*some_iterator` constructs to get to the underlying location. Some of these should be re-considered after switching to c++20. Issues: chipsalliance#2323
hzeller
added a commit
to hzeller/verible
that referenced
this issue
Jan 12, 2025
There were a few assumptions in the code that these types are equivalent, but they are not on all platforms. The fixes sometimes involve ugly `&*some_iterator` constructs to get to the underlying location. Some of these should be re-considered after switching to c++20. Issues: chipsalliance#2323
hzeller
added a commit
to hzeller/verible
that referenced
this issue
Jan 12, 2025
There were a few assumptions in the code that these types are equivalent, but they are not on all platforms. The fixes sometimes involve ugly `&*some_iterator` constructs to get to the underlying location. Some of these should be re-considered after switching to c++20. Issues: chipsalliance#2323
hzeller
added a commit
to hzeller/verible
that referenced
this issue
Jan 12, 2025
There were a few assumptions in the code that these types are equivalent, but they are not on all platforms. The fixes sometimes involve ugly `&*some_iterator` constructs to get to the underlying location. Some of these should be re-considered after switching to c++20. Issues: chipsalliance#2323
hzeller
added a commit
to hzeller/verible
that referenced
this issue
Jan 12, 2025
There were a few assumptions in the code that these types are equivalent, but they are not on all platforms. The fixes sometimes involve ugly `&*some_iterator` constructs to get to the underlying location. Some of these should be re-considered after switching to c++20. Issues: chipsalliance#2323
hzeller
added a commit
to hzeller/verible
that referenced
this issue
Jan 12, 2025
There were a few assumptions in the code that these types are equivalent, but they are not on all platforms. The fixes sometimes involve ugly `&*some_iterator` constructs to get to the underlying location. Some of these should be re-considered after switching to c++20. Issues: chipsalliance#2323
hzeller
added a commit
to hzeller/verible
that referenced
this issue
Jan 13, 2025
There were a few assumptions in the code that these types are equivalent, but they are not on all platforms. The fixes sometimes involve ugly `&*some_iterator` constructs to get to the underlying location. Some of these should be re-considered after switching to c++20. Issues: chipsalliance#2323
hzeller
added a commit
to hzeller/verible
that referenced
this issue
Jan 13, 2025
There were a few assumptions in the code that these types are equivalent, but they are not on all platforms. The fixes sometimes involve ugly `&*some_iterator` constructs to get to the underlying location. Some of these should be re-considered after switching to c++20. Issues: chipsalliance#2323
hzeller
added a commit
to hzeller/verible
that referenced
this issue
Jan 13, 2025
There were a few assumptions in the code that these types are equivalent, but they are not on all platforms. The fixes sometimes involve ugly `&*some_iterator` constructs to get to the underlying location. Some of these should be re-considered after switching to c++20. We also have a `string_view_null_iterator()` function to generate an iterator that is not initialized to be used in place where we previously used comparison against nullptr. Issues: chipsalliance#2323
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A lot of code within Verible assumes that the iterator of
string_view
just decays toconst char*
. This assumption was true whileabsl::string_view
was the implementation used, and even after switching to c++17, is as well true for gcc/clang standard library std::string_view.However, on Windows, the iterator is its own wrapper object that can not be assigned to
const char*
, so Verible would fail to compile if we used thatstd::string_view
there.Thus, for a long while, we have a patch to tell abseil to always use the internal
absl::string_view
internal implementation on Windows and not just typedefabsl::string_view
tostd::string_view
.However, due to that patch, our abseil-cpp in MODULES.bazel deviates from others users that depend on Verible in the registry. Not sure if this will be a problem, but it is an additional reason to get this fixed.
It would be good to remove these assumptions. This will probably involve using
absl::string_view::iterator
instead ofconst char*
for parameters and data members where the intent is to work with iterators.Also construction of
std::string_view
's that use iterators as start point will be different.This is a collection issue to collect all the pull requests towards that goal until everything is done.
Exit criteria: we can replace all
absl::string_view
withstd::string_view
and code compiles on all platforms.The text was updated successfully, but these errors were encountered: