autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCHv5] _AC_DO _AC_DO_STDERR: Evaluate argument twice


From: Nikolai Merinov
Subject: Re: [PATCHv5] _AC_DO _AC_DO_STDERR: Evaluate argument twice
Date: Wed, 13 Jan 2021 17:09:58 +0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi Zack,

I signed a copyright assignment for GNU Autoconf project; tracking task
for this issue is https://savannah.gnu.org/support/index.php?110395

If you are ready to review suggested changes I can provide any required
improvements.

Regards,
Nikolai

Nikolai Merinov <nikolai.merinov@member.fsf.org> writes:

>> Zack Weinberg <zackw@panix.com> writes:
>>> Please also file a tracking bug for this change at
>>> https://savannah.gnu.org/support/?func=additem&group=autoconf so we
>>> don't forget about it again.
>>>
>>> Finally, I haven't reviewed the code in detail but I would like to see
>>> more comprehensive tests. Right now you're only testing one word in
>>> quotes in CFLAGS; blindly stripping the quotes would do the right
>>> thing.  If I understand your goal correctly, you should be testing
>>> things like `configure CC="cc -std=c89"` and
>>> `CPPFLAGS="-Dfunction_like_macro(with, arguments)=..."` (put something
>>> in the ... that actually uses the arguments).
>
> Updated patch with improved test cases attached. 
>
> I provided 4 test cases:
>
>  1. AC_COMPILE_IFELSE with pre-created CPPFLAGS. This test will fail with
>     current autoconf code.
>  2. Compilation of the same code where CPPFLAGS passed through
>     Makefile.in. This one will work with current autoconf code
>     correctly.
>  3. AC_RUN_IFELSE with function call passed through CPPFLAGS. This test
>     will fail with current autoconf code.
>  4. Running of the same code where CPPFLAGS passed through
>     Makefile.in. This test will work correctly with current autoconf
>     code.
>
> I think that the tests pairs 1, 2 and 3, 4 should always provide same
> results. Without suggested modification they gives us different
> results.
>
>>> Please also try to
>>> think of situations where double evaluation would do the *wrong*
>>> thing; that will help us understand the potential negative
>>> consequences of this change.
>
> I can suggest only one scenario when double evaluation would do wron
> thing: Custom _AC_DO_STDERR command that used only through
> configuration, but never will be reproduced in Makefile.in. Something
> like
>
>> _AC_DO_STDERR([echo \"hello\" >&2]) && test "$(cat conftest.err)" = '"hello"'
>
> Regards,
> Nikolai



reply via email to

[Prev in Thread] Current Thread [Next in Thread]