RFR: 8307160: Fix AWT/2D/A11Y to support the permissive- flag on the Microsoft Visual C compiler [v18]
Phil Race
prr at openjdk.org
Fri Nov 3 05:09:14 UTC 2023
On Fri, 3 Nov 2023 04:57:26 GMT, Julian Waters <jwaters at openjdk.org> wrote:
> Actually, I can do you one better, now that I think of it, so I don't have to explains potentially deeply nested and confusing error logs:
>
> ```
> int main() {
> goto skip;
> int i = 0;
> skip:
> std::printf("Done\n");
> }
> ```
>
> C:\Users\vertig0\Downloads>cl.exe -nologo -std:c++14 -permissive- -Fo:goto.o goto.cpp
>
> goto.cpp(5): error C2362: initialization of 'c' is skipped by 'goto skip' goto.cpp(6): note: see declaration of 'skip'
>
> You simply cannot jump over initialization of a local with a goto in C++, as shown by the Visual C compiler above, does this answer your question?
It tells me 2 things
(1) C++ is awful, because the change you made to silence it is a no-op
(2) the changes you are making are really wrong, because C++ is telling us it does not like goto, and you aren't addresssing that
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15096#issuecomment-1791898759
More information about the client-libs-dev
mailing list