consistent unspecified pointer comparison
Martin Uecker
muecker@gwdg.de
Thu Jun 27 18:20:26 GMT 2024
Am Donnerstag, dem 27.06.2024 um 13:02 -0400 schrieb Jason Merrill via Gcc:
> https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2434r1.html
> proposes to require that repeated unspecified comparisons be
> self-consistent, which does not match current behavior in either GCC
> or Clang. The argument is that the current allowance to be
> inconsistent is user-unfriendly and does not enable significant
> optimizations. Any feedback about this?
Making pointer comparison self-consistent in cases where there is
no UB makes a lot of sense, because everything else is dangerous.
This is not the only thing this paper proposes. I do not think
angelic / demonic nondeterminism is good language design, and
especially think it is not a good fit for systems languages
such as C or C++. Also most programmers will not understand it.
Martin
More information about the Gcc
mailing list