bug-autoconf
[Top][All Lists]
Advanced

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

Re: autoreconf breaks shell functions in configure.ac


From: Mike Frysinger
Subject: Re: autoreconf breaks shell functions in configure.ac
Date: Sun, 14 Jan 2018 03:23:30 -0500

On 13 Jan 2018 21:42, Yuri wrote:
> I added this function to configure.ac:
> 
> log2() {
>    x=0
>    y=$(($1>>1))
>    while [ $y -gt 0 ]; do
>      x=$((x+1))
>      y=$((y>>1))
>    done
>    echo $x
> }
> 
> 
> After autoreconf, this function looks like this:
> 
> log2() {
>    x=0
>    y=$(($1>>1))
>    while  $y -gt 0 ; do
>      x=$((x+1))
>      y=$((y>>1))
>    done
>    echo $x
> }
> 
> 
> The brackets are dropped around the argument of 'while'.
> 
> This alters the outcome of this function. Now, instead of computing the 
> log2(x) function, it breaks: x.sh: 3: not found
> 
> 
> I believe, this is a major bug that the body of the shell function is 
> altered.

this isn't a bug, but WAI.  please see the chapters on quotation:
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/M4-Quotation.html
-mike

Attachment: signature.asc
Description: Digital signature


reply via email to

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