RFR: 8297963: Partially fix string expansion issues in the autoconf UTIL macros [v3]

Julian Waters jwaters at openjdk.org
Fri Dec 2 13:35:21 UTC 2022


On Fri, 2 Dec 2022 13:23:43 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

>> 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 five additional commits since the last revision:
>> 
>>  - 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
>
> make/autoconf/util.m4 line 394:
> 
>> 392:   m4_if(ARG_IF_NOT_GIVEN, , [m4_define([ARG_IF_NOT_GIVEN], [:])])
>> 393:   m4_if(ARG_IF_ENABLED, , [m4_define([ARG_IF_ENABLED], [:])])
>> 394:   m4_if(ARG_IF_DISABLED, , [m4_define([ARG_IF_DISABLED], [:])])
> 
> This definitely look cleaner. Was it needed to get things to work, or just a clean-up? (I'm just curious)

The former, the code blocks inside ARG_IF_GIVEN and similar were getting expanded multiple times prior to the change, which was wreaking quite a lot of havoc on any shell code that they might have contained. I ultimately solved that by simply deliberately avoiding their redefinition if they were not empty (m4_define needs to be quoted here because it would expand and start redefining the macro otherwise irregardless of whether their check actually passed or not!)

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

PR: https://git.openjdk.org/jdk/pull/11458



More information about the build-dev mailing list