RFR: 8307160: Fix AWT/2D/A11Y to support the permissive- flag on the Microsoft Visual C compiler [v14]

Phil Race prr at openjdk.org
Fri Nov 3 04:32:12 UTC 2023


On Fri, 3 Nov 2023 02:29:58 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> src/java.desktop/windows/native/libawt/windows/awt_Canvas.cpp line 218:
>> 
>>> 216: 
>>> 217:     AwtCanvas *c;
>>> 218:     c = (AwtCanvas*) pData;
>> 
>> you probably explained it in some other thread, perhaps in an earlier review but what exactly is the problem with the existing code ? The new code looks like something that begs to be undone.
>
> The problem is that the goto jumps over the initialization of these locals, which C++ does not allow. However, a split declaration and assignment can be jumped over by goto if the local is a primitive type, hence this change is needed

Really I hate this change. It is wrong.  Well I could go further than that. I have no idea why C++ thinks one is OK and the other is not. Please show the EXACT WARNING FROM THE COMPILER. (Actually why aren't you showing us what the problems are ? )  I don't know if I want to change C++ or something else. Actually C++ is a problem in itself, but that's a personal opinion. If goto is the specific problem and the only thing we can change then we should eliminate goto.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15096#discussion_r1381150116


More information about the client-libs-dev mailing list