autoconf
[Top][All Lists]
Advanced

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

Re: Why does autoupdate remove spaces after commas in AC_INIT only?


From: Eric Blake
Subject: Re: Why does autoupdate remove spaces after commas in AC_INIT only?
Date: Wed, 6 Mar 2019 07:21:58 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

On 3/6/19 2:31 AM, Matthieu Poullet wrote:
> Hello,
> 
> I've just updated a bunch of configure.ac with autoupdate 2.69 and it
> removes all spaces after commas in the AC_INIT macro and only in this
> macro, e.g.
> 
> diff --git a/flaim-ch8-10/configure.ac b/flaim-ch8-10/configure.ac
> index baa0a1c..a724bbc 100644
> --- a/flaim-ch8-10/configure.ac
> +++ b/flaim-ch8-10/configure.ac
> @@ -1,8 +1,8 @@
>  #                                               -*- Autoconf -*-
>  # Process this file with autoconf to produce a configure script.
> 
> -AC_PREREQ([2.62])
> -AC_INIT([flaim-projects], [1.0])
> +AC_PREREQ([2.69])
> +AC_INIT([flaim-projects],[1.0])
>  AM_INIT_AUTOMAKE([-Wall -Werror foreign])
>  LT_PREREQ([2.2])
>  LT_INIT([dlopen])
> 
> So my questions are:
> - is it a bug?

Not a functional bug. Due to m4 quoting rules (where unquoted spaces
after , when collecting macro arguments are stripped), the following are
identical in behavior:
AC_INIT([a],    [b])
AC_INIT([a],[b])

But as it does look different, a patch to avoid the reformatting would
be accepted (however, I suspect such a patch would be extremely
difficult to write, as autoupdate is using m4 to figure out which macros
to rewrite, and m4 doesn't track how many spaces it discarded, for you
to know how many spaces to add back).

> - is it a feature/a best practice? if yes, does it mean that autoconf
> recommends not using spaces after commas and why does it not touch the
> other macros then?

Style-wise, space after comma is more legible, but it is not required.
As for why other macros are untouched, it is because autoupdate uses m4
to look for a select handful of macros, and intentionally ignores all
other macros - the spaces are only eaten on the macros that autoupdate
is looking for, and AC_INIT happens to be one of those macros.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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