RFR: 8297963: Partially fix string expansion issues in UTIL_DEFUN_NAMED and related macros [v7]
Julian Waters
jwaters at openjdk.org
Tue Dec 6 08:44:50 UTC 2022
On Mon, 5 Dec 2022 09:40:37 GMT, Julian Waters <jwaters at openjdk.org> wrote:
>> The UTIL macros have several problematic flaws that may not seem apparent initially, the worst of which include parsing commas as actual argument separators to the underlying m4 macros, and completely, but very subtly wrecking shell constructs. I've done my best here to fix some of these issues in this commit, so others don't end up suffering like I did while I was trying to implement [8296478](https://github.com/openjdk/jdk/pull/11020). Most notably, DESC and CHECKING_MSG should now function correctly when a comma is included as part of their description strings (Other named arguments do not yet have this fix implemented, it was simply far too tedious, but it should be straightforward after this commit to fix those as well). I've also fixed several bugs that seem to have flown under the radar (Such as UTIL_DEFUN_NAMED always adding an extra space in between the parameter name and actual value, even if not required). Majority of the fix involved UTIL_DEFUN_NAMED, however while it
now properly passes along arguments it receives to macros that use it to implement their logic, the latter still need to be mindful of macro expansions inside their _own_ body
>>
>>
>>
>> A couple of limitations from the original implementation still remain: You still cannot have the parameter specifier inside its own block, for instance IF_GIVEN: [IF_GIVEN: []] would not work properly (IF_GIVEN: [IF_GIVEN []] without the colon in the inner string will, however). Additionally, if a space is not given in between the parameter and its value (Eg DEFAULT:[] instead of the usual DEFAULT: []) the processing that UTIL_DEFUN_NAMED performs to correct this problem will still interfere with shell code that relies on the : token. Unfortunately, despite my best efforts I was unable to properly resolve these last 2 limitations
>
> Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision:
>
> - Merge branch 'openjdk:master' into patch-2
> - Merge branch 'openjdk:master' into patch-2
> - Comment
> - Slightly overproofed code can be removed
> - Merge branch 'openjdk:master' into patch-2
> - FLAGS_COMPILER_CHECK_ARGUMENTS should not quote ARG_ arguments
> - Remove special ARG_ handling in UTIL_DEFUN_NAMED
> - Wording
> - Partially fix string expansion issues in autoconf UTIL macros
WHOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
-------------
PR: https://git.openjdk.org/jdk/pull/11458
More information about the build-dev
mailing list