* src/m4.c (usage, main): Detect write failures to stderr.
[m4/ericb.git] / NEWS
blob3c2045529e69018fe8e7737176672d0de3b53f42
1 GNU M4 NEWS - User visible changes.
2 Copyright (C) 1992, 1993, 1994, 2004, 2005, 2006 Free Software
3 Foundation, Inc.
5 Version 1.4.8 - ?? ??? 2006, by ??  (CVS version 1.4.7a)
7 * The `--help' and `--version' command line options now consistently
8   override all earlier options.  For example, `m4 --debugfile=trace
9   --help' now no longer accidentally creates an empty file `trace'.
10 * The `-L'/`--nesting-limit' command line option can now be set to 0
11   to remove the default limit of 1024.  However, it is still possible that
12   heavily nested input can cause abrupt program termination due to stack
13   overflow.
14 * Problems encountered when writing to standard error, such as with the
15   `errprint' macro, now always cause a non-zero exit status.
17 Version 1.4.7 - 25 September 2006, by Eric Blake  (CVS version 1.4.6a)
19 * Fix regression from 1.4.5 in handling a file that ends in a macro
20   expansion without arguments instead of a newline.
21 * The define and pushdef macros now warn when the first argument is not
22   a string, rather than silently doing nothing.
23 * Standard input can now be read more than once, as in 'm4 - file -', and
24   is not closed until all wrapped text is handled.  This makes a
25   difference when stdin is not a regular file, and also fixes bugs when
26   using the syscmd or esyscmd macros from wrapped text.
27 * When standard input is a seekable file, the m4exit, syscmd, and esyscmd
28   macros now restore the current position to the next unread byte rather
29   than discarding an arbitrary amount of buffered data.
30 * SysV command-line compatibility is no longer a goal of GNU M4; the
31   focus will be instead on POSIX compatibility.  This release continues to
32   support previous usage, but adds warnings in areas which will allow a
33   future version of GNU M4 to use its own extensions without being tied to
34   the SysV command line interface.
35 * The no-op compatibility command line options -B, -N, -S, -T, and
36   --diversions may be withdrawn or assigned new meanings in future
37   releases, so they now issue a warning if used.
38 * A new command line option -i replaces the compatibility -e as the
39   short spelling of --interactive, for consistency with other GNU tools; a
40   warning is issued if the old spelling is used, and it may be assigned new
41   meaning in future releases.
42 * A new command line option --debugfile replaces the options -o and
43   --error-output as the preferred spelling.  The old options were
44   misleading in their names and inconsistent with other GNU tools; they are
45   still silently accepted, but no longer documented in --help, and may be
46   assigned new meanings in future releases.
48 Version 1.4.6 - 25 August 2006, by Eric Blake  (CVS version 1.4.5a)
50 * Fix buffer overruns in regexp and patsubst macros when handed a trailing
51   backslash in the replacement text, or when handling \n substitutions
52   beyond the number of \(\) groups.
53 * Fix memory leak in regexp, patsubst, and changeword macros.
54 * The format macro now understands %F, %g, and %G.
55 * When loading frozen files, m4 now exits with status 63 if version
56   mismatch is detected.
57 * Fix bugs that occurred when invoked with stdout or stderr closed,
58   and detect write failures to stdout or to the target of the
59   debugfile macro.  In particular, the syscmd and esyscmd macros can
60   no longer interfere with the debug stream or diversions.
61 * The m4exit macro now converts values outside the range 0-255 to 1.
62 * It is now an error if a command-line input file ends in the middle of a
63   comment, matching the behavior of mid-string and mid-argument
64   collection.
65 * The dnl macro now warns if end of file is encountered instead of a
66   newline.
67 * The error message when end of file is encountered now uses the file and
68   line where the dangling construct started, rather than `NONE:0:'.
69 * The debugmode and __file__ macros, and the -s/--synclines option, now
70   show what directory a file was found in when the -I/--include option or
71   M4PATH variable had an effect.
72 * The changequote and changecom macros now work with 8-bit characters, and
73   quotes and comments that begin with `(' are properly recognized
74   following a word.
75 * The new macro __program__ is added, which allows the input file to issue
76   an error message that resembles messages from m4.  Warning and error
77   messages have been reformatted to comply with GNU Coding Standards.
78 * The errprint, m4wrap, and shift macros are now recognized only with
79   arguments.
80 * The index, substr, translit, regexp, and patsubst macros now produce
81   output when given only one argument, but still warn about a missing
82   second argument.
83 * The patsubst macro now reliably finds zero-length matches at the end
84   of a string.
86 Version 1.4.5 - 15 July 2006, by Eric Blake  (CVS version 1.4.4c)
88 * Fix sysval on BeOS, OS/2, and other systems that store exit status
89   in the low-order byte.  Additionally, on Unix platforms, if syscmd was
90   terminated by a signal, sysval now displays the signal number shifted
91   left by eight bits, to match traditional m4 implementations.
92 * The maketemp macro is no longer subject to platform limitations (such as
93   26 or 32 max files from a given template).
94 * Frozen files now require that the first directive be V (version), to
95   better diagnose version mismatch.  Additionally, if the F directive
96   (builtin function) names an unknown builtin that existed in the m4 that
97   froze the file but not in the current m4 (for example, changeword), the
98   warning is deferred until an attempt is made to actually use the
99   builtin.  This allows downgrading from beta m4-1.4o to stable m4-1.4.5
100   without breaking autoconf.
101 * The format and indir macros are now recognized only with arguments.
102 * The eval macro no longer crashes on x86 architectures when dividing the
103   minimum integer by -1.
104 * On systems with ecvt and fcvt, format no longer truncates trailing
105   zeroes on integers printed with %.0f.  On systems without these
106   functions, format is no longer subject to a buffer overflow that
107   permitted arbitrary code execution.
108 * On native Windows builds, the macro __windows__ is provided instead of
109   __unix__.  Likewise, on OS/2 builds, the macro __os2__ is provided.  This
110   allows input files to determine when syscmd might behave differently.
111 * Fix bug in 1.4.3 patch to use \n line-endings that did not work for
112   cygwin.
113 * When given the empty string or 0, undivert is now documented as a no-op
114   rather than closing stdout, warning about a non-existent file, or trying
115   to read a directory as a file.
116 * Many documentation improvements.  Also, the manual is now distributed
117   under FDL 1.2, rather than a stricter verbatim-only license.
118 * Raise the -L (--nesting-limit) command line option limit from 250 to
119   1024.
120 * The decr, incr, divert, m4exit, and substr macros treat an empty number
121   as 0, issue a warning, and expand as normal; rather than issuing an error
122   and expanding to the empty string.
123 * The eval macro now treats an empty radix argument as 10, handles radix 1,
124   and treats the width argument as number of digits excluding the sign,
125   for compatibility with other m4 implementations.
126 * The ifdef, divert, m4exit, substr, and translit macros now correctly
127   ignore extra arguments.
128 * The popdef and undefine macros now correctly accept multiple arguments.
129 * Although changeword is on its last leg, if enabled, it now reverts to the
130   default (faster) regexp when passed the empty string.
131 * The regexp and substr macros now warn and ignore a trailing backslash in
132   the replacement, and warn on \n for n larger than the number of
133   sub-expressions in the regexp.
135 Version 1.4.4b - 17 June 2006, by Eric Blake  (CVS version 1.4.4a)
137 * Fix a recursive push_string crashing bug, which affected changequote of
138   three or more characters on some compilers.
139 * Use automake to fix build portability issues.
140 * Fix a recursive m4wrap crashing bug.
141 * Fix a 1 in 2**32 hash crashing bug.
142 * Tracing a macro by name is now persistent, even if the macro is
143   subsequently undefined or redefined.  The traceon and traceoff macros no
144   longer warn about undefined symbols.  This solves a crash when using
145   indir on an undefined macro traced with the -t option, as well as an
146   incorrect result of ifdef.  Furthermore, tracing is no longer transferred
147   with builtins, solving the bug of "m4 -tm4_eval" failing to give trace
148   output on the input "define(`m4_eval',defn(`eval'))m4_eval(1)".
149 * Fix a crash when a macro is undefined while collecting its arguments, by
150   always using the definition that was in effect before argument
151   collection.  This behavior matches the C pre-processor, and means that
152   the sequence "define(`f',`1')f(define(`f',`2'))f" is now documented to
153   result in "12", rather than the previously undocumented "22".
154 * Update the regex engine to fix several bugs.
155 * Fix a potential crash on machines where char is signed.
157 Version 1.4.4 - October 2005, by Gary V. Vaughan
159 * ./configure --infodir=/usr/share/info now works correctly.
160 * When any file named on the command line is missing exit with status 1.
162 Version 1.4.3 - March 2005, by Gary V. Vaughan
164 * DESTDIR installs now work correctly.
165 * Don't segfault with uncompilable regexps to changeword().
166 * Always use \n line-endings for frozen files (fixes a Windows bug).
167 * Portability fix for systems lacking mkstemp(3).
168 * Approximately 20% speed up in the common case of usage with autoconf.
169 * Supported on QNX 6.3.
171 Version 1.4.2 - August 2004, by Paul Eggert
173 * No user visible changes; portability bug fixes only.
175 Version 1.4.1 - June 2004, by Paul Eggert
177 * maketemp now creates an empty file with the given name, instead of merely
178   returning the name of a nonexistent file.  This closes a security hole.
180 Version 1.4 - October 1994, by Franc,ois Pinard
182 (No user visible changes)
184 Version 1.3 - September 1994, by Franc,ois Pinard
186 * Diversions are created as needed.  Option `-N' is still accepted, but
187 otherwise ignored.  Users should use only negative diversion numbers,
188 instead of high positive numbers, for diverting to nowhere.
190 * Diversions should also work faster.  No temporary files will be needed
191 at all if all diversions taken altogether do not use more than 512K.
193 * Frozen state files may be produced with the `--freeze-state' (-F)
194 option and later brought back through the `--reload-state' (-R) option.
196 Version 1.2 - July 1994, by Franc,ois Pinard
198 * In patsubst(STRING, REGEXP, REPLACEMENT), \& in REPLACEMENT has been
199 changed to represent this part of STRING matched by the whole REGEXP,
200 instead of the whole STRING as before.  \0 does the same, but emits a
201 diagnostic saying it will disappear in some subsequent release.
203 * eval(EXPR) emits a diagnostic if EXPR has suffixed crumb.  The same for
204 other numeric conversions in incr(), decr(), divert(), etc.
206 * `--fatal-warnings' (-E) stops execution at first warning.
208 * `--nesting-limit=LEVEL' (-L LEVEL) sets a limit to macro nesting.
209 It is initially fixed at 250.
211 * `--word-regexp=REGEXP' (-W REGEXP) modifies macro name syntax, like
212 does the new `changeword(REGEXP)' macro.  This feature is experimental,
213 tell me your opinions about it.  You do need --enable-changeword at
214 configure time to get these things.  Do *not* depend on them yet.
216 * Trace output format is scannable by GNU Emacs' next-error function.
218 * Stack overflow is detected and diagnosed on some capable systems.
220 * Various bugs have been corrected, m4 should be more portable.  See the
221 ChangeLog for details.
223 Version 1.1 - November 1993, by Franc,ois Pinard
225 Changes which might affect existing GNU m4 scripts:
227 * Option `-V' has been removed, use `--version' instead.  `--version'
228 writes on standard output instead of standard error, and inhibits any
229 script execution.
231 * `--no-gnu-extensions' has been renamed `--traditional'.
233 * In `eval', `^' used to indicate exponentiation, use `**' instead.
235 * The automatic undiversion which takes place at end of all input is
236 forced into the main output stream.
238 Changes which are unlikely to affect existing scripts:
240 * `--help' prints an usage summary on standard output.  Script execution
241 is then inhibited.
243 * `--prefix-builtins' (-P) prefixes all builtin macros by `m4_'.
245 * Most builtin macros for which arguments are mandatory, called without
246 any arguments, are no more recognized as builtin macros: they are
247 consequently copied verbatim to the output stream.
249 * `define' and `pushdef' are usable with only one argument, they give
250 this argument an empty definition.
252 * `eval' new operators for binary representation handling: `^' for
253 exclusive-or, `~' for the bitwise negation, `<<' and `>>' for shifts.
255 * `eval' recognizes the notation 0bDIGITS for binary numbers and the
256 notation 0rRADIX:DIGITS for numbers in any radix from 1 to 36.
258 Version 1.0.3 - December 1992, by Franc,ois Pinard
260 Changes for the user:
262 * `dnl' outputs a diagnostic if immediately followed by `('.  Usually,
263 `dnl' is followed by newline or whitespace.
265 * `ifelse' accepts without complaining the common idiom of having only
266 one argument.  This is useful for introducing long comments.
268 * `eval' always expresses values as signed, whatever the radix.
270 * M4OPTS environment variable is no longer obeyed.
272 * `--no-warnings' option is renamed `--silent'.
274 * Debug lines use a new format more compatible with GNU standards.
276 * Various bugs have been corrected.  See the ChangeLog for details.
278 Changes for the installer:
280 * GNU m4 now uses an Autoconf-generated configure script, and should be
281 more easily portable in many ways.  (Cray is not supported yet).
283 * `make check' has been made more portable, expect no errors.
285 Changes for the programmer:
287 * Sources have been fully reindented to comply with GNU standards, and
288 cleaned up in many ways.
290 * Sources have been protoized.  Non-ANSI compilers are automatically
291 detected, then sources are unprotoized on the fly before compilation.
293 * GNU m4 uses newer versions of obstack, regex, getopt, etc.
295 Version 1.0 - October 1991, by Rene' Seindal
297 * Uses GNU configure, taken from the gdb distribution.
299 * Uses GNU getopt(), with long option names.
301 * The -Q/+quiet option is added, which suppresses warnings about missing
302 or superflous arguments to built-in macros.
304 * Added default options via the M4OPTS environment variable.
306 * Several minor bugs have been fixed.
308 Version 0.99 - July 1991, by Rene' Seindal
310 * The builtins `incr' and `decr' are now implemented without use of
311 `eval'.
313 * The builtin `indir' is added, to allow for indirect macro calls
314 (allows use of "illegal" macro names).
316 * The debugging and tracing facilities has been enhanced considerably.
317 See the manual for details.
319 * The -tMACRO option is added, marks MACRO for tracing as soon as it
320 is defined.
322 * Builtins are traced after renaming iff they were before.
324 * Named files can now be undiverted.
326 * The -Nnum option can be used to increase the number of divertions
327 available.
329 * Calling changecom without arguments now disables all comment handling.
331 * A bug in `dnl' is fixed.
333 * A bug in the multi-character quoting code is fixed.
335 * Several typos in the manual has been corrected.  More probably persist.
337 Version 0.75 - November 1990, by Rene' Seindal
339 * Implemented search path for include files (-I option and M4PATH
340 environment variable).
342 * Implemented builtin `format' for printf-like formatting.
344 * Implemented builtin `regexp' for searching for regular expressions.
346 * Implemented builtin `patsubst' for substitution with regular
347 expressions.
349 * Implemented builtin `esyscmd', which expands to a shell commands output.
351 * Implemented `__file__' and `__line__' for use in error messages.
353 * Implemented character ranges in `translit'.
355 * Implemented control over debugging output.
357 * Implemented multi-character quotes.
359 * Implemented multi-character comment delimiters.
361 * Changed predefined macro `gnu' to `__gnu__'.
363 * Changed predefined macro `unix' to `__unix__', when the -G option is
364 not used.  With -G, `unix' is still defined.
366 * Added program name to error messages.
368 * Fixed two missing null bytes bugs.
370 Version 0.50 - January 1990, by Rene' Seindal
372 * Initial beta release.
374 Local Variables:
375 mode: outline
376 fill-column: 75
377 End: