https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91227

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egallager at gcc dot gnu.org
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=81453

--- Comment #10 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #8)
> (In reply to rguent...@suse.de from comment #5)
> > Does "unspecified" allow p > q != !(p <= q)?  I think so (it's not
> > implementation defined).
> 
> The exact C++ words that apply here are:
> 
> (4.3)  Otherwise [if two unequal pointers don't point into the same object],
> neither pointer is required to compare greater than the other.
> 
> (it's not explicitly unspecified, but it sounds at least as loose).  So the
> answer is yes.
> 
> I agree with producing a sensible result for QoI (especially if there's no
> warning).  A result that's consistent between [in]equality and relational
> expressions would qualify.
> 
> I also agree that diagnosing all these unspecified (or undefined in C) cases
> would be helpful as they (at least in the straightforward instances) are
> most likely coding mistakes.  I might look into it, though my first concern
> is about the instances that result from some earlier transformations and
> where warnings will be seen as false positives.

Now that you're getting into the diagnostics aspect of this I'd just like to
point out that this could be tied in with fixing bug 81453 at the same time and
the new warnings could be grouped under the -Wordered-pointer-comparison flag
proposed there

Reply via email to