bug-autoconf
[Top][All Lists]
Advanced

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

autoreconf breaks shell functions in configure.ac


From: Yuri
Subject: autoreconf breaks shell functions in configure.ac
Date: Sat, 13 Jan 2018 21:42:44 -0800
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

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.


autoconf-2.69_1 on FreeBSD 11.1


Yuri





reply via email to

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