bug-m4
[Top][All Lists]
Advanced

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

sysval and doc fixes [was: GNU M4 1.4.4b released (beta release)]


From: Eric Blake
Subject: sysval and doc fixes [was: GNU M4 1.4.4b released (beta release)]
Date: Sun, 18 Jun 2006 21:28:31 +0000

> 
> Can you try that patch, backported to 1.4.4b, to see if it also solves
> the issue for OS/2?  If so, I'll check it in.

On second thought, even if it doesn't help OS/2, it will help BeOS,
so I'm checking it in, along with an additional patch to beef up
the testsuite so that we validate an actual non-zero exit value (the
exit value of false is non-portable).  But hopefully OS/2 does
define WEXITSTATUS.

> 
> 2006-05-08  Bruno Haible  <address@hidden>  (tiny change)
>           Eric Blake  <address@hidden>
> 
>       * src/builtin.c (WEXITSTATUS): Provide fallback definition.
>       (m4_esyscmd): Set sysval to 0xffff, to accomodate both
>       big-endian and little-endian wait status definitions.
>       (m4_sysval): Use WEXITSTATUS.
>       Reported by Andreas Buening.
> 
2006-06-18  Eric Blake  <address@hidden>

        Consistently use "GNU M4" as package name, "m4" as executable
        name.
        * NEWS: Document previous fix.
        * THANKS: Update.
        * README: Fix grammar.  Document that --enable-changeword is on
        its last leg.
        * doc/m4.texinfo (Top): Likewise.
        (Sysval): Enhance this test.
        (History): Backport this section from CVS head, and update.
Index: AUTHORS
===================================================================
RCS file: /sources/m4/m4/AUTHORS,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 AUTHORS
--- AUTHORS     29 May 2006 16:38:07 -0000      1.2.2.1
+++ AUTHORS     18 Jun 2006 21:25:19 -0000
@@ -1,7 +1,7 @@
-Authors of GNU m4.
+Authors of GNU M4.
 
 The following contributors have warranted legal paper exchanges with
-the Free Software Foundation for their contributions to GNU m4.  Also
+the Free Software Foundation for their contributions to GNU M4.  Also
 see the files ChangeLog and THANKS.
 
 This list comes from "sed -ne '/^M4/,/^$/p' /gd/gnuorg/copyright.list"
Index: NEWS
===================================================================
RCS file: /sources/m4/m4/NEWS,v
retrieving revision 1.1.1.1.2.21
diff -u -p -r1.1.1.1.2.21 NEWS
--- NEWS        18 Jun 2006 20:38:02 -0000      1.1.1.1.2.21
+++ NEWS        18 Jun 2006 21:25:20 -0000
@@ -1,10 +1,11 @@
-GNU m4 NEWS - User visible changes.
+GNU M4 NEWS - User visible changes.
 Copyright (C) 1992, 1993, 1994, 2004, 2005, 2006 Free Software
 Foundation, Inc.
 
 Version 1.4.5 - ?? 2006, by ???  (CVS version 1.4.4c)
 
-* No user-visible changes, yet.
+* Fix sysval on BeOS, OS/2, and other systems that store exit status
+  in the low-order byte.
 
 Version 1.4.4b - 17 June 2006, by Eric Blake  (CVS version 1.4.4a)
 
Index: README
===================================================================
RCS file: /sources/m4/m4/README,v
retrieving revision 1.1.1.1.2.1
diff -u -p -r1.1.1.1.2.1 README
--- README      18 Oct 2005 11:29:12 -0000      1.1.1.1.2.1
+++ README      18 Jun 2006 21:25:20 -0000
@@ -5,8 +5,8 @@ to macros).  `m4' also has built-in func
 running shell commands, doing arithmetic, etc.  Autoconf needs GNU
 `m4' for generating `configure' scripts, but not for running them.
 
-GNU `m4' has been originally written by Rene' Seindal, from Denmark.
-This release is to be considered as stable.
+GNU `m4' was originally written by Rene' Seindal, from Denmark.
+This release is considered stable.
 
 If GNU `m4' is meant to serve GNU `autoconf', beware that `m4'
 should be fully installed *prior to* configuring `autoconf' itself.
@@ -23,7 +23,9 @@ See file `THANKS' for a list of contribu
 
 By using `./configure --enable-changeword', you get an experimental
 feature which allows for changing the syntax of what is a "word" in
-`m4'.  This might go away, so don't count on it yet.
+`m4'.  This feature will not be present in m4 2.0, but will be
+replaced by other new features which provide the same capability, so
+do not count on it.
 
 Send bug reports to address@hidden'.  A bug report is an adequate
 description of the problem: your input, what you expected, what you got,
Index: THANKS
===================================================================
RCS file: /sources/m4/m4/THANKS,v
retrieving revision 1.1.1.1.2.8
diff -u -p -r1.1.1.1.2.8 THANKS
--- THANKS      15 Jun 2006 13:08:45 -0000      1.1.1.1.2.8
+++ THANKS      18 Jun 2006 21:25:20 -0000
@@ -1,7 +1,7 @@
-GNU m4 THANKS file
+GNU M4 THANKS file
 
-GNU m4 has originally been written by René Seindal.  Many people
-further contributed to GNU m4 by reporting problems, suggesting
+GNU M4 was originally written by René Seindal.  Many people
+further contributed to GNU M4 by reporting problems, suggesting
 various improvements or submitting actual code.  Here is a list of
 these people.  Help me keep it complete and exempt of errors.
 
@@ -20,6 +20,7 @@ Bernhard Daeubler     address@hidden
 Bjorn R. Bjornsson     address@hidden
 Bob Badour             address@hidden
 Brendan Kehoe          address@hidden
+Bruno Haible           address@hidden
 Damian Menscher                address@hidden
 David J. MacKenzie     address@hidden
 Erez Zadok             address@hidden
Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.20
diff -u -p -r1.1.1.1.2.20 m4.texinfo
--- doc/m4.texinfo      16 Jun 2006 03:09:14 -0000      1.1.1.1.2.20
+++ doc/m4.texinfo      18 Jun 2006 21:25:20 -0000
@@ -100,8 +100,10 @@ You should use:
 @end example
 @noindent
 if you want this feature compiled in.  The current implementation
-slows down @code{m4} considerably and is hardly acceptable.  So, it
-might go away, do not count on it yet.
+slows down @code{m4} considerably and is hardly acceptable.  In the
+future, @code{m4} 2.0 will come with a different set of new features
+that provide similar capabilities, but without the inefficiencies, so
+changeword will go away and you should not count on it.
 
 @menu
 * Preliminaries::               Introduction and preliminaries
@@ -228,8 +230,8 @@ Miscellaneous builtin macros
 
 Compatibility with other versions of @code{m4}
 
-* Extensions::                  Extensions in GNU m4
-* Incompatibilities::           Facilities in System V m4 not in GNU m4
+* Extensions::                  Extensions in GNU M4
+* Incompatibilities::           Facilities in System V m4 not in GNU M4
 * Other Incompatibilities::     Other incompatibilities
 
 @end detailmenu
@@ -289,22 +291,56 @@ debugging their @code{m4} scripts than d
 @node History, Invoking m4, Intro, Preliminaries
 @section Historical references
 
-The historical notes included here are fairly incomplete, and not
-authoritative at all.  Please knowledgeable users help us to more
-properly write this section.
-
 @code{GPM} has been an important ancestor of @code{m4}.  See
 C. Stratchey: ``A General Purpose Macro generator'', Computer Journal
 8,3 (1965), pp. 225 ff.  @code{GPM} is also succinctly described into
 David Gries classic ``Compiler Construction for Digital Computers''.
 
-While @code{GPM} was @emph{pure}, @code{m4} was meant to deal more
-with the true intricacies of real life: macros could be recognized
-with being pre-announced, skipping whitespace or end-of-lines was
-made easier, more constructs were builtin instead of derived, etc.
-
-Originally, @code{m4} was the engine for Rational FORTRAN preprocessor,
-that is, the @code{ratfor} equivalent of @code{cpp}.
+The classic B. Kernighan and P.J. Plauger: ``Software Tools'',
+Addison-Wesley, Inc. (1976) describes and implements a Unix
+macro-processor language, which inspired Dennis Ritchie to write
address@hidden, a macro processor for the AP-3 minicomputer.
+
+Kernighan and Ritchie then joined forces to develop the original
address@hidden, as described in ``The M4 Macro Processor'', Bell
+Laboratories (1977) which had only 21 builtin macros.
+
+While @code{GPM} was more @emph{pure}, @code{m4} is meant to deal with
+the true intricacies of real life: macros can be recognized without
+being pre-announced, skipping whitespace or end-of-lines is easier,
+more constructs are builtin instead of derived, etc.
+
+Originally, the Kernighan and Plauger macro-processor, and then
address@hidden formed the engine for the Rational FORTRAN preprocessor,
+that is, the @code{Ratfor} equivalent of @code{cpp}.  Later, @code{m4}
+was used as a frontend for @code{Ratfor}, @code{C} and @code{Cobol}.
+
+Ren@'e Seindal released his implementation of @code{m4}, GNU @code{m4},
+in 1990, with the aim of removing the artificial limitations in many
+of the traditional @code{m4}'s: like maximum line length, macro size,
+number of macros and so on.
+
+The late Professor A. Dain Samples described and implemented a further
+evolution in the form of @code{M5}: ``User's Guide to the M5 Macro
+Language: 2nd edition'', Electronic Announcement on comp.compilers
+newsgroup (1992).
+
+Fran@,{c}ois Pinard took over maintainance of GNU @code{m4} in 1992, until
+1994 when he released GNU @code{m4} 1.4, which was the stable release
+for 10 years.  It was at this time that GNU Autoconf decided to require
+GNU @code{m4} as its underlying engine, since all other implementations
+of @code{m4} had too many limitations.
+
+More recently, in 2004, Paul Eggert released 1.4.1 and 1.4.2 which
+addressed some long standing bugs in the venerable 1.4 release.
+Then in 2005 Gary V. Vaughan collected together the many
+patches to GNU @code{m4} 1.4 that were floating around the net and
+released 1.4.3 and 1.4.4.  And in 2006, Eric Blake joined the team and
+prepared patches for the release of 1.4.5.
+
+Meanwhile, development has continued on new features for @code{m4}, such
+as dynamic module loading and additional builtins.  When complete, GNU
address@hidden 2.0 will start a new series of releases.
 
 @node Invoking m4, Bugs, History, Preliminaries
 @section Invoking @code{m4}
@@ -1986,9 +2022,10 @@ changecom
 The macro @code{changeword} and all associated functionality is
 experimental.  It is only available if the @code{--enable-changeword}
 option was given to @code{configure}, at GNU @code{m4} installation
-time.  The functionality might change or even go away in the future.
address@hidden not rely on it}.  Please direct your comments about it the
-same way you would do for bugs.
+time.  The functionality will go away in the future, to be replaced by
+other new features that are more efficient at providing the same
+capabilities.  @emph{Do not rely on it}.  Please direct your comments
+about it the same way you would do for bugs.
 @end quotation
 
 A file being processed by @code{m4} is split into quoted strings, words
@@ -2095,7 +2132,8 @@ lexical analysis of macro definition whe
 the macro is @emph{used}.
 
 You should note that using @code{changeword} will slow @code{m4} down
-by a factor of about seven.
+by a factor of about seven, once it is changed to be something other
+than the default regular expression.
 
 @node M4wrap,  , Changeword, Input Control
 @section Saving input
@@ -3100,6 +3138,10 @@ syscmd(`false')
 @result{}
 ifelse(sysval, 0, zero, non-zero)
 @result{}non-zero
+syscmd(`exit 2')
address@hidden
+sysval
address@hidden
 syscmd(`true')
 @result{}
 sysval
@@ -3410,8 +3452,8 @@ There are also differences in BSD flavor
 is made to summarize these here.
 
 @menu
-* Extensions::                  Extensions in GNU m4
-* Incompatibilities::           Facilities in System V m4 not in GNU m4
+* Extensions::                  Extensions in GNU M4
+* Incompatibilities::           Facilities in System V m4 not in GNU M4
 * Other Incompatibilities::     Other incompatibilities
 @end menu
 
Index: src/builtin.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/builtin.c,v
retrieving revision 1.1.1.1.2.11
diff -u -p -r1.1.1.1.2.11 builtin.c
--- src/builtin.c       15 Jun 2006 21:51:37 -0000      1.1.1.1.2.11
+++ src/builtin.c       18 Jun 2006 21:25:20 -0000
@@ -745,6 +745,10 @@ m4_defn (struct obstack *obs, int argc, 
 | and "sysval".  "esyscmd" is GNU specific.                              |
 `------------------------------------------------------------------------*/
 
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(status) (((status) >> 8) & 0xff)
+#endif
+
 /* Exit code from last "syscmd" command.  */
 static int sysval;
 
@@ -774,7 +778,7 @@ m4_esyscmd (struct obstack *obs, int arg
     {
       M4ERROR ((warning_status, errno,
                "Cannot open pipe to command \"%s\"", ARG (1)));
-      sysval = 0xff << 8;
+      sysval = 0xffff;
     }
   else
     {
@@ -787,7 +791,7 @@ m4_esyscmd (struct obstack *obs, int arg
 static void
 m4_sysval (struct obstack *obs, int argc, token_data **argv)
 {
-  shipout_int (obs, (sysval >> 8) & 0xff);
+  shipout_int (obs, WEXITSTATUS (sysval));
 }
 
 /*-------------------------------------------------------------------------.

reply via email to

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