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