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