On Thu, 24 Mar 2011 09:02:42 -0400
James Kuyper <> wrote:
> On 03/23/2011 08:05 PM, Spiros Bousbouras wrote:
> > On Tue, 22 Mar 2011 21:45:42 -0400
> > James Kuyper<> wrote:
> ...
> >> What I consider to be the usual meaning of "same" is rendered almost
> >> completely non-existent by removing transitivity. Whatever it is that
> >> you think is left of the idea after removing that feature needs to be
> >> explained in considerably more detail than the above paragraph.
> >
> > The key issue is that SRAR() may not be transitive. That's the only
> > explanation I can offer.
>
> Then you've failed to explain it. There's infinitely many possible
> intransitive relationships between two C types; but there's not a single
> one them for which I would consider "same representation and alignment"
> a sane description.
Which would make it a "damn poor choice of terminology" as I said earlier.
But you seem convinced that whatever other errors the committee members
might have made , they would not make this particular one , they would
never use the word "same" to describe a relation which is not
transitive. My view is that people have made worse errors so why not
this one ?
> You don't have to describe to us the actual
> relationship that you thought the committee meant to describe; if you're
> not sure what that relationship was. It just has to be an precisely
> described example of a relationship that would fit the context.
A relation between 2 types which is symmetric and therefore would
guarantee that
int foo2(void) {
char c = 0 , *p = &c ;
void *v = (void *) p ;
return p == (char *)v ;
}
always returns 1. Since you have convinced me that the foo() which I
posted earlier ([1]) always returns 1 regardless of the transitivity of
SRAR() , I don't see any point in having SRAR() be transitive which
makes it even more uncertain how "same" should be understood. But
symmetry of SRAR() is still important for the code above and that's an
argument in favour of "same" having its usual meaning.
> I need that description so I can ask you my next question: "How in the
> world could you possibly imagine that the committee might describe that
> relationships by saying 'same representation and alignment'?".
People make mistakes.
> Alternatively, your example might make the answer to that question so
> clear to me that I won't have to ask it - but that seems unlikely at
> this point.
>
> >> More to the point, the key flaw in the footnote is neither the symmetry
> >> nor the transitivity of SRAR();
> >
> > The properties of SRAR() is the key issue.
>
> It's an important issue for you. Those properties are irrelevant to the
> problem with that footnote, since that problem can be demonstrated
> without any reference to the transitivity or symmetry of SRAR.
So you say but I don't see it.
> >> it's the failure to keep in mind that
> >> there are features of a type other than it's representation and
> >> alignment which can affect the interchangeability with another type.
> >
> > Also the failure to bring that fact to the reader's attention.
>
> That's not a separate issue. Failure to bring a fact to the reader's
> attention is a pretty much inevitable consequence of failing to think
> about the fact in the first place.
Ok , I shouldn't have said "Also". So perhaps they did think about it
and they still decided to leave the footnote as it is for whatever
reason. Perhaps their only omission was not realising that the footnote
is misleading as it is written.
> >> No, it is the phrase "is meant to imply" that leads to the problems;
> >> "same" is just an innocent bystander.
> >
> > Since you think that it unambiguously determines the properties of
> > SRAR() then you certainly can't consider it an innocent bystander.
>
> But the problem is not the properties of SRAR, but rather the additional
> issues that were not even mentioned while describing SRAR. Granted, I
> believe that the issues that weren't mentioned, are issues not covered
> by SRAR. However, my belief that those issues are not covered by SRAR
> has nothing to do with the word "same", it has to do with the words
> "representation" and "alignment". Neither of those words can be
> stretched to cover such issues as which registers are used to pass
> values to and from a function during a function call. Suggesting a
> bizarre alternative meaning of "same" is not sufficient to stretch the
> concept to cover those issues.
Why the standard would have anything whatsoever to say about which
registers are used to pass values to functions ? C is supposed to
abstract away from such stuff.
> >> Larry Jones has posted a message
> >> in another branch of this thread that describes the intended meaning.
> >> Keith has suggested that more appropriate wording to cover the intended
> >> meaning would have used the phrase "recommended practice"; I agree.
> >> There's no need to assume that "same" was intended to convey a meaning
> >> almost completely divorced from it's normal one.
> >
> > After Larry Jones's latest intervention perhaps not. But I'd rather he
> > post some code to make it clearer what the intention is.
>
> Me too. It seems to me that "interchangeability" inherently implies
> constraining the range of behavior under some situations which currently
> have undefined behavior. I'd appreciate knowing whether or not that
> understanding matches the committee's intent.
So your theory is that if footnote 39 of 6.2.5 p26 did not have the
flaw you say it has then certain behaviors which now are undefined ,
would become defined in those implementations which would follow the
recommendation in the footnote. Do you have some specific code in mind
which would become defined ?
> >> I can't even imagine what "same" would mean if it were neither symmetric
> >> nor transitive. Without those two features, I would strongly recommend
> >> using some entirely different English word for whatever concept it is
> >> that you're trying to describe - perhaps "similar"?
> >
> > I have already used different words. I have said
> > *** SRAR() may not be transitive ***.
> > You don't see any mention of "same" in that phrase , do you ?
>
> Yes, I do. The capital S in "SRAR" is an abbreviation for "same".
You know what ? I had completely forgotten about that. But I think this
is actually a good thing. Because all I see now is an abstract relation
and the question is what are the properties of the relation and what is
the correspondence between the relation and the semantics of the language.
> The
> only definition provided by the standard is exactly four words long, one
> of which is "same".
Actually it was me who defined SRAR.
> Any interpretation of that phrase which drops the
> transitivity implied by the word "same" has a meaning that I can't wrap
> my head around.
So I suggest that you stop thinking about "same" and think in terms of
"SRAR" without paying attention to which words inspired the name
"SRAR". In fact , since you say that the flaw you think footnote 39 has
is independent from whether SRAR() is symmetric or transitive , you
actually don't lose anything by forgetting about "same" and what
properties it may imply.
> If you care whether or not anyone has any idea what it
> is you're talking about, you have to explain the idea better than simply
> saying it's not transitive.
I do and that's why I posted some code. So far I'm the only one who
has.
> > Not really and in any case I'm kind of fed up discussing the meaning of
> > "same" in the footnote. As I've just said in [1] I don't consider it
> > the right approach to interpreting the footnote. For me much more
> > relevant is the question I ask above :
> >
> > Would it be guaranteed to be true without assuming that
> > SRAR() is symmetric and transitive ?
>
> No. The faults that prevent it from being true would still remain,
> whether or not SRAR were symmetric and transitive.
The context appears in [1]. According to "The code you've posted is
guaranteed to return 1" below, the answer should be yes.
> > The question refers to code which has been snipped when it shouldn't
> > have but I'm also fed up posting the code again and again.
>
> The code you've posted is guaranteed to return 1 because of the rules
> for conversions between the different pointer types. Section 6.3.2.3p7,
> and particularly the last sentence of that paragraph, is the key
> reference for that conclusion. SRAR and interchangeability have nothing
> to do with it. It's guaranteed to return 1 even on implementations where
> they are NOT interchangeable. It would still be guaranteed to return 1
> even if the standard were changed to allow those pointer types to have
> completely unrelated representations, so long as it continued to say
> what it currently says in 6.3.2.3p7. What it says in that clause does
> imply that all three character types must have an alignment of 1, and
> therefore the same alignment, but that's only one half of SRAR.
Good point. It didn't occur to me that the last sentence of 6.3.2.3 p7
implies that all char types have alignment of 1.
[1] <nJaip.82224$2>
http://groups.google.com/group/comp....6?dmode=source
--
Did you ever wonder how much deeper the ocean would be if it weren't
full of sponges?
Steven Wright