<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On 13 Jan 2017 4:40 am, "Dimitry Andric via cfe-commits" <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">On 22 Oct 2016, at 00:00, Richard Smith via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
><br>
> Author: rsmith<br>
> Date: Fri Oct 21 17:00:42 2016<br>
> New Revision: 284890<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=284890&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=284890&view=rev</a><br>
> Log:<br>
> DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.<br>
> This has two significant effects:<br>
><br>
> 1) Direct relational comparisons between null pointer constants (0 and nullopt)<br>
>   and pointers are now ill-formed. This was always the case for C, and it<br>
>   appears that C++ only ever permitted by accident. For instance, cases like<br>
>     nullptr < &a<br>
>   are now rejected.<br>
><br>
> 2) Comparisons and conditional operators between differently-cv-qualified<br>
>   pointer types now work, and produce a composite type that both source<br>
>   pointer types can convert to (when possible). For instance, comparison<br>
>   between 'int **' and 'const int **' is now valid, and uses an intermediate<br>
>   type of 'const int *const *'.<br>
><br>
> Clang previously supported #2 as an extension.<br>
><br>
> We do not accept the cases in #1 as an extension. I've tested a fair amount of<br>
> code to check that this doesn't break it, but if it turns out that someone is<br>
> relying on this, we can easily add it back as an extension.<br>
><br>
> This is a re-commit of r284800.<br>
<br>
</div>Hi Richard,<br>
<br>
This indeed leads to a bit of breakage when we compile lots of FreeBSD ports, for example openjdk7 (<a href="https://bugs.freebsd.org/216016" rel="noreferrer" target="_blank">https://bugs.freebsd.org/<wbr>216016</a>), ptlib (<a href="https://bugs.freebsd.org/216019" rel="noreferrer" target="_blank">https://bugs.freebsd.org/<wbr>216019</a>), spidermonkey24 (<a href="https://bugs.freebsd.org/216010" rel="noreferrer" target="_blank">https://bugs.freebsd.org/<wbr>216010</a>), and webkit-qt4 (<a href="https://bugs.freebsd.org/216015" rel="noreferrer" target="_blank">https://bugs.freebsd.org/<wbr>216015</a>) will now produce errors similar to:<br>
<br>
vidinput_v4l.cxx:981:23: error: ordered comparison between pointer and zero ('BYTE *' (aka 'unsigned char *') and 'int')<br>
      if (videoBuffer < 0) {<br>
          ~~~~~~~~~~~ ^ ~<br>
<br>
There will probably be more of these.  Is it the intent of this change that such software must now be patched up?<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">That is the intent; such code is not valid c++ any more per the latest defect resolutions (and is not valid C). Depending on the level of pain, we could allow these comparisons as an extension, so I would welcome your input here. However (for instance) the example above looks like a bug.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Dimitry<br>
<br>
<br>______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div></div></div>