On Fri, 13 May 2022 08:56:59 GMT, Yasumasa Suenaga <ysuen...@openjdk.org> wrote:

> GCC 12 reports as following:

You forced me to look at this in depth. The values are set via the build 
system. In the build system it is impossible to get just -J because the -J is 
only added as a prefix for an existing string. So basically this is impossible 
code to reach unless you manually override the build system definition. So as 
far as I can see this is a classic case where we want an assert.


if (arg[0] == '-' && arg[1] == 'J') {
    assert(arg[2] != '\0', "Invalid JAVA_ARGS or EXTRA_JAVA_ARGS defined by 
build");
    *nargv++ = JLI_StringDup(arg + 2);
}

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

PR: https://git.openjdk.java.net/jdk/pull/8694

Reply via email to