<div dir="ltr"><div dir="ltr">On Sun, Apr 20, 2025 at 11:29 AM Joshua Root <<a href="mailto:jmr@macports.org">jmr@macports.org</a>> wrote:<br></div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On 21/4/2025 01:27, Nils Breunese wrote:<br>
> I created a draft pull request to bump the openjdk11 port to version 11.0.27 (<a href="https://github.com/macports/macports-ports/pull/28212" rel="noreferrer" target="_blank">https://github.com/macports/macports-ports/pull/28212</a>), but it looks like this line:<br>
> <br>
> AO_UNUSED_MBZ = (-1)<<13, // options bits reserved for future use.<br>
> <br>
> in src/jdk.pack/share/native/common-unpack/constants.h results in this error on macOS 15:<br>
> <br>
> expression is not an integral constant expression<br>
> <br>
> On macOS 13 and 14 the build succeeds without this error.<br>
> <br>
> I am not too familiar with C++, but does this seem related to a change in macOS 15? Any idea what should be done to fix the build on macOS 15?<br>
<br>
It would be a compiler change rather than a change in the OS. I believe <br>
using bitwise shift operators on a negative value has undefined <br>
behaviour. The fix would be to express the constant in a well-defined <br>
way, for example directly as a hex value, or by shifting a positive <br>
value and then negating afterwards. I don't know how this constant is <br>
used, so I can't say what would be most appropriate.</blockquote><div><br></div><div><a href="http://cppreference.com">cppreference.com</a> says that is undefined behavior. That constant is defined as an enum, which I think means only that it needs to be a correctly defined integer. Try something like this:</div><div><br></div><div> AO_UNUSED_MBZ = (~((1<<13) - 1))</div></div></div>