Kean Johnston | 1 Nov 01:21 2005

Bug in latest install-sh

There is a bug in teh latest install-sh that is in m4 1.4.4.
It uses 'trap - 0' to restore the trap. Using 'trap -' is
a bash-ism and not portable. The works-everywhere syntax is
simply to use 'trap 0'. Attached is a patch.

Kean
Index: install-sh
===================================================================
RCS file: /cvs/opensrc/gnutools/m4/install-sh,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 install-sh
--- install-sh	28 Oct 2005 05:20:39 -0000	1.1.1.1
+++ install-sh	1 Nov 2005 00:17:35 -0000
 <at>  <at>  -389,7 +389,7  <at>  <at>  do
 	 }
     } || exit 1

-    trap - 0
+    trap 0
   fi
 done

_______________________________________________
Bug-m4 mailing list
Bug-m4 <at> gnu.org
http://lists.gnu.org/mailman/listinfo/bug-m4
(Continue reading)

Stepan Kasal | 1 Nov 07:14 2005
Picon

Re: Bug in latest install-sh

Hello,
  thank you for your bug report.

On Mon, Oct 31, 2005 at 04:21:31PM -0800, Kean Johnston wrote:
> There is a bug in teh latest install-sh that is in m4 1.4.4.

This is the latest install-sh in the Automake CVS.
So this bug report belongs to bug-automake, where I'm forwarding it.

> It uses 'trap - 0' to restore the trap. Using 'trap -' is
> a bash-ism and not portable. The works-everywhere syntax is
> simply to use 'trap 0'. Attached is a patch.

I looked at POSIX, and 'trap - 0' is standardized, while 'trap 0' is not.

The Autoconf manual doesn't mention this protability problem; would you
be so kind to provide details about your setup (which OS, which shell, and
its versions)?  I'd like to add the info to the manual.  (Ccing to
bug-autoconf, too.)

If "trap - 0" doesn't work on your system, would "trap '' 0" work?
Or perhaps "trap : 0"?

Have a nice day,
	Stepan
haibin zhang | 1 Nov 08:44 2005
Picon

can't use m4-1.4.4 to compile autoconf-2.59 in Mingw32

Hi All:

I can comiple m4-1.4.4 in mingw, but can't use it to
do anything!

I found that m4-1.4.4 can't use to compile
autoconf-2.59, I don't know the reason, Can you help
me to fix the bug?

If you don't have Mingw run environment, you can
download it from
http://www.sourceforge.net/projects/mingw-install , it
can run m4-1.4 ,and the newest version of  autoconf
,automake and libtool.

I really need you help , thanks.

	

	
		
___________________________________________________________ 
雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱 
http://cn.mail.yahoo.com
Kean Johnston | 1 Nov 08:53 2005

Re: Bug in latest install-sh

Stepan Kasal wrote:
> Hello,
>   thank you for your bug report.
> 
> On Mon, Oct 31, 2005 at 04:21:31PM -0800, Kean Johnston wrote:
> 
>>There is a bug in teh latest install-sh that is in m4 1.4.4.
> 
> 
> This is the latest install-sh in the Automake CVS.
> So this bug report belongs to bug-automake, where I'm forwarding it.
Ah ok thank you.

> I looked at POSIX, and 'trap - 0' is standardized, while 'trap 0' is not.
Ok thats a fair comment. But then if you want to use POSIX
shell scripts shouldn't you ensure you are running in a
POSIX shell? On most SYstem V machines I know, /bin/sh is
a "pure" Bourne shell, and very unlikely to be POSIX
compliant. Thats what ksh is for. But the script uses
#! /bin/sh so on anything other than a fairly modern system,
that is very unlikely to get you a POSIX compliant shell.

> The Autoconf manual doesn't mention this protability problem; would you
> be so kind to provide details about your setup (which OS, which shell, and
> its versions)?  I'd like to add the info to the manual.  (Ccing to
> bug-autoconf, too.)
Certainly. SCO OpenServer 5, SCO OpenServer 6, SCO UnixWare 2,
SCO UnixWare 7. But I took a look around ...
http://docs.sun.com/app/docs/doc/816-5165/6mbb0m9sa?a=view#indexterm-694
(Solaris 10 man page for sh) doesn't support trap - either, but
(Continue reading)

Gary V. Vaughan | 1 Nov 10:42 2005
Picon

Re: can't use m4-1.4.4 to compile autoconf-2.59 in Mingw32

I'm afraid I don't have mingw, or even windows (not
even a PC for that matter), so I won't be able to
reproduce your problem.

haibin zhang wrote:
> I can comiple m4-1.4.4 in mingw, but can't use it to
> do anything!
> 
> I found that m4-1.4.4 can't use to compile
> autoconf-2.59, I don't know the reason, Can you help
> me to fix the bug?

I might be able to see what is happening if you
show me the error.

Cheers,
	Gary.
--

-- 
Gary V. Vaughan      ())_.  gary <at> {lilith.warpmail.net,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
_______________________________________________
Bug-m4 mailing list
Bug-m4 <at> gnu.org
http://lists.gnu.org/mailman/listinfo/bug-m4
Eric Blake | 3 Nov 04:18 2005
Picon

Re: Bug in latest install-sh


According to Stepan Kasal on 10/31/2005 11:14 PM:
> 
> If "trap - 0" doesn't work on your system, would "trap '' 0" work?
> Or perhaps "trap : 0"?

Be aware that in general, replacing - with '' or : is wrong: POSIX
requires "trap '' 0" to ignore the signal, and "trap : 0" to execute the
(no-op) : on occurance of the signal, rather than restoring the default
behavior.  But in the special case of signal 0, doing nothing at exit
happens to be the default behavior, so if this works, we might as well
document it and fix install-sh accordingly.

--
Life is short - so eat dessert first!

Eric Blake             ebb9 <at> byu.net
Damian Menscher | 4 Nov 23:19 2005
Picon

documentation typo

http://www.gnu.org/software/m4/manual/m4.html

s/woould/would/

Damian Menscher
--

-- 
-=#| <menscher <at> uiuc.edu> www.uiuc.edu/~menscher/ Ofc:(650)253-2757 |#=-
-=#| The above opinions are not necessarily those of my employers. |#=-
Ilya N. Golubev | 10 Nov 16:08 2005
Picon

recursive push_string with non-gnu cc

Versions: 1.4, 1.4.3, 1.4.4.

Build configurations: all with non-gnu compiler.  (Actually observed
with native `cc' of `alpha-dec-osf5.1'.)

In these configurations `obstack_grow' macro in `lib/obstack.h'
evaluates its 1st arg several times.  If this arg is `push_string_init
()', this causes m4 internal error.

	* input.c (match_input): Do not pass expression with
	side effect to `obstack_grow'.  Fix <INTERNAL ERROR: Recursive
	push_string!>.

--- input.c	Sun May  1 15:38:18 2005
+++ input.c	Thu Nov 10 17:10:05 2005
 <at>  <at>  -531,7 +531,12  <at>  <at> 
     }

   /* Failed, push back input.  */
-  obstack_grow (push_string_init (), t, n);
+  {
+    struct obstack *h = push_string_init ();
+
+    /* `obstack_grow' may be macro evaluating its arg 1 several times. */
+    obstack_grow (h, t, n);
+  }
   push_string_finish ();
   return 0;
 }
(Continue reading)


Gmane