C++ Logo

sg12

Advanced search

Re: [ub] C provenance semantics proposal

From: Peter Sewell <Peter.Sewell_at_[hidden]>
Date: Mon, 15 Apr 2019 15:32:32 +0100
Hi Jens (M),

On Sat, 13 Apr 2019 at 20:00, Jens Maurer <Jens.Maurer_at_[hidden]> wrote:
>
> On 13/04/2019 14.50, Uecker, Martin wrote:
> > Am Samstag, den 13.04.2019, 13:04 +0200 schrieb Jens Maurer:
> >> On 13/04/2019 12.07, Freek Wiedijk wrote:
> >>> Hi Jens,
> >>>
> >>>> So, it seems the opinion of WG14 in C DR 260 is at odds with the current
> >>>> normative text. Maybe WG14 wants to revisit and update C DR 260, at
> >>>> least with a marker "obsolete" or so.
> >>>
> >>> I thought that after the C standard gets a new version,
> >>> the DR's before that automatically become "obsolete",
> >>> because they are supposed to have been integrated in the
> >>> standard after that?
> >>
> >> Yes.
> >>
> >> However, C DR 260 is from 2004 and doesn't seem to propose
> >> a change in wording; instead, it just interprets the existing
> >> normative text. Yet, I'm failing to reconcile the "committee
> >> response" in C DR 260 with the C11 text about pointer equality.
> >
> > Why? The response talks about indeterminate values and includes
> > a vague hint about the generic idea of treating pointers
> > differently based on origin. But there is nothing even remotely
> > contradicting the rules about pointer equality.
>
> So, are you saying that p1==p2 may be true, yet p1 and p2
> might be treated differently, e.g. when dereferenced?

yes

> It actually seems C++ has the same rule, because two pointers
> compare equal if "both represent the same address" (except for
> the one-past-the-end case, where C++ says the equality comparison
> is unspecified).
>
> Jens
> _______________________________________________
> ub mailing list
> ub_at_[hidden]
> http://www.open-std.org/mailman/listinfo/ub

Received on 2019-04-15 16:32:45