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