1 GNU m4 NEWS - History of user-visible changes. -*- outline -*-
2 Copyright (C) 1992, 1993, 1994, 1998, 2000, 2001, 2006, 2007, 2008 Free
3 Software Foundation, Inc.
5 * Noteworthy changes in Version 1.9b (200x-??-??) [beta]
6 Released by ????, based on git version 1.9a-*
8 NOTE - there are still a number of FIXMEs to resolve before this can be
13 *** The build environment has been updated to modern GNU practices,
14 depending on newer features of Autoconf, Automake, Libtool, Gettext,
15 and Gnulib to be more portable to a wide variety of platforms.
17 ** New command line behavior
19 *** If the POSIXLY_CORRECT environment variable is set, it implies the
20 `-G' and `-Q' options, effectively giving a more fully POSIX-compliant
21 implementation with only compatible GNU extensions.
23 *** New `-b'/`--batch' command-line option to force non-interactive mode.
24 Also, in addition to `-e'/`--interactive' requesting interactive mode,
25 m4 now follows the lead of sh, and automatically enters interactive
26 mode when there are no files specified, and when both standard input
27 and standard error are terminals.
29 *** New `-B'/`--prepend-include' command-line option allows prepending to
30 the include path, rather than always searching `.' first.
32 *** The `-d'/`--debug' command-line option now understands `-' and `+'
33 modifiers, the way `debugmode' has always done. The option
34 `--debugmode' is added as an alias for `-d'.
36 *** New `--debuglen' command-line option matches the spelling of a new
37 macro, and the old spelling `--arglength' now issues a warning that it
38 might be withdrawn in the future.
40 *** New `-g'/`--gnu' command-line option overrides `-G'/`--traditional',
41 allowing the GNU module to be selected even when POSIXLY_CORRECT.
43 *** The `-H'/`--hashsize' command-line options, which were made no-ops in
44 a previous beta, now issue a deprecation warning.
46 *** The `-L'/`--nesting-limit' command-line option now performs argument
47 validation and accepts an optional multiplier suffix.
49 *** The `-o'/`--error-output' command-line options, which were replaced by
50 `--debugfile' in M4 1.4.7, now issue a deprecation warning. This
51 warning interferes with all versions of Autoconf prior to 2.61, so plan
52 on installing an updated Autoconf when installing M4 2.0.
54 *** New `-p'/`--pushdef' and `--popdef' command-line options allow more
55 control over macro definitions from the command line between input
58 *** New `--posix' command-line option is a synonym for `-G'/`--traditional'.
60 *** New `-r'/`--regexp-syntax' command-line option changes the default
61 regular expression syntax used by M4. Without this option, M4
62 continues to use EMACS style expressions. A new section in the info
63 docs explains the differences between them, and what builtins are
66 *** New `--safer' command-line option cripples the potentially unsafe
67 builtins `debugfile', `esyscmd', `maketemp', `mkdtemp', `mkstemp', and
70 *** New `--syncoutput' command-line option matches the builtin added in a
71 previous beta, and provides more control over sync line generation
72 from the command line between input files. The previous options
73 `-s'/`--synclines' remain as aliases for `--syncoutput=1'.
75 *** New `--traceoff' command-line option, and new spelling `--traceon' for
76 `--trace', allow more control over macro tracing from the command line
79 *** New `--unload-module' command-line option allows more control over
80 dynamic modules from the command line. Also, `-m'/`--load-module' now
81 acts between input files.
83 *** New `--warnings' command-line option re-enables warnings, overriding
84 `-Q'/`--quiet'/`--silent', allowing warnings even when POSIXLY_CORRECT.
88 *** The `defn' builtin now allows any number of arguments, as POSIX requires.
89 - FIXME: This still doesn't work with concatenating builtins with text.
91 - FIXME: POSIX recommends using ${10} instead of $10 for the tenth
92 positional argument. We should deprecate $10.
94 - FIXME: `m4wrap' semantics need an update to FIFO.
98 *** The experimental `epatsubst' and `eregexp' builtins have been removed
99 in favor of a new `changeresyntax' builtin.
103 *** New `changeresyntax' builtin allows programmatic setting of the default
104 regular expression flavor, to match `-r'/`--regexp-syntax' command-line
107 *** New `debuglen' builtin allows runtime setting of debug output length,
108 previously controlled only by the `-l' command line argument.
109 Additionally, whether using the new macro or the command line argument,
110 the length limitation now affects dumpdef output as well as trace
111 output, undergoes argument validation, and accepts an optional
113 - FIXME the multiplier suffix isn't reliable yet
115 *** New `mkdtemp' builtin parallels `mkstemp', but allows the creation of
116 temporary directories instead of files.
118 *** New `refcount' builtin allows tracking how many times a module has
120 - FIXME: consider making m4modules smarter for this purpose
122 *** New `renamesyms' builtin allows programmatic renaming of all symbols
123 according to a regular expression.
124 - FIXME: This feature can cause core dumps when renaming multiple
125 symbols to the same name.
127 *** New `__traditional__' builtin identifies when the traditional module
128 is loaded instead of the gnu module.
130 *** The `modules' and `symbols' builtins, introduced in previous betas,
131 have been renamed `m4modules' and `m4symbols', in order to minimize
132 problems when upgrading from 1.4.x and processing English text. To
133 prevent future problems, any future macro added as a GNU extension will
134 either be blind (ie. be unrecognized without arguments), or begin with
135 the prefix `m4' or `__'.
137 ** Changed behavior of builtins
139 *** The module identifier builtins, such as `__gnu__', `__m4_version__',
140 and `__unix__', now warn if given arguments.
142 *** The `builtin' builtin now has a special form, where if the first
143 argument is exactly the special token representing defn(`builtin'), the
144 expansion is the special token representing the builtin named in the
145 second argument. This allows regenerating a macro with a more
146 efficient mapping directly to a builtin function, rather than through
147 textual indirection through further expansions of `builtin'.
149 *** The `changecom' builtin semantics now match traditional
150 implementations; if the start-comment string resembles a macro name or
151 the start-quote string, comments are effectively disabled.
153 *** The `changesyntax' builtin has been improved, to make it easier to add
154 and remove characters from a syntax class without having to specify the
155 entire set of characters in that class. It also supports new syntax
156 categories, `$', `{' and `}', for extended argument handling in macro
157 definitions. See the manual for more examples.
159 *** New `m' flag to `-d'/`--debug' command-line option or `debugmode'
160 builtin traces actions related to module loading and unloading, and
161 affects `dumpdef' and trace output to show where builtins come from.
162 New `s' flag shows the entire stack of `pushdef' definitions during
163 `dumpdef'. The `c' flag has been updated to output two lines instead
164 of three (since the last two had always been paired), and to add
165 information to the first line to show the definition of the macro being
166 expanded. The 'e' flag has been updated to output non-text expansions.
168 *** The `divert' builtin now accepts an optional second argument of text
169 that is immediately placed on the new diversion, regardless of whether
170 the current expansion is nested within argument collection of another
173 *** The `dumpdef' builtin now always outputs to standard error, rather than
174 the debug file specified by the `--debugfile' option or `debugfile'
177 *** The `eval' and `mpeval' builtins now support the following new
178 operators: `>>>', `\', `?:', and `,'.
180 *** The `maketemp' builtin now always warns that it is obsolete, even in GNU
181 mode where it uses the same secure algorithm as `mkstemp', because of
182 the recommendation of POSIX to obsolete `maketemp' as inherently
183 insecure when obeying POSIX.
185 *** The `m4symbols' builtin now warns if given a builtin token instead of
186 a macro name. It remains silent for undefined macros.
188 *** The `patsubst' and `regexp' builtins have a new optional 4th argument
189 to use a different regular expression syntax for the duration of that
192 *** The semantics of the `traceon' and `traceoff' builtins now match
193 traditional implementations: when called without arguments, they affect
194 global state rather than affecting only the macros defined at that
195 moment. The manual includes an example of how to recover 1.4.x
200 *** The syntax of frozen files format V2 has been improved to save
201 additional state. This includes the `R' directive for default regular
202 expression syntax. Also, a V2 file can now be represented completely
203 in ASCII, thanks to escape sequences. Unfortunately, files frozen by
204 M4 1.4q that contain \ in macros cannot be read by 1.9b, but since 1.4q
205 was not widely distributed, this is not expected to be much of an
206 issue, and comes with the territory of using a beta release.
207 - FIXME: format 2 still needs to catch more missing state; once 2.0 is
208 released, any further changes would introduce format 3.
210 *** Improvements made in the 1.4.x stable series have been incorporated.
213 * Noteworthy changes in Version 1.4.11 (????-??-??) [stable]
214 Released by ????, based on git version 1.4.10b.x-*
216 ** Fix regression introduced in 1.4.10b where using `builtin' or `indir'
217 to perform nested `shift' calls triggered an assertion failure.
219 ** Enhance the `ifdef', `ifelse', and `shift' builtins, as well as all
220 user macros, to transparently handle builtin tokens generated by `defn'.
222 ** Enhance the `defn', `dumpdef', `ifdef', `popdef', `traceon', `traceoff',
223 and `undefine' macros to warn when encountering a builtin token in the
224 context of a macro name, rather than acting on the empty string. This
225 was already done for `define', `pushdef', `builtin', and `indir'.
227 * Noteworthy changes in Version 1.4.10b (2008-02-25) [beta]
228 Released by Eric Blake, based on git version 1.4.10a
230 ** Security fixes for the -F option, for bugs present since -F was
231 introduced in 1.3: Avoid core dump with 'm4 -F file -t undefined', and
232 avoid arbitrary code execution with certain file names.
234 ** Fix regression introduced in 1.4.9b in the `divert' builtin when more
235 than 512 kibibytes are saved in diversions on platforms like NetBSD
236 where fopen(name,"a+") seeks to the end of the file.
238 ** The output of the `maketemp' and `mkstemp' builtins is now quoted if a
239 file was created. This is a minor security fix, because it was possible
240 (although rather unlikely) that an unquoted string could match an
241 existing macro name, such that use of the `mkstemp' output would trigger
242 inadvertent macro expansion and operate on the wrong file name.
244 ** Enhance the `defn' builtin to support concatenation of multiple text
245 arguments, as required by POSIX. However, at this time, it is not
246 possible to concatenate a builtin macro with anything else; a warning is
247 now issued if this is attempted, although a future version of M4 may
248 lift this restriction to match other implementations.
250 ** Enhance the `index' builtin to guarantee linear behavior and often
251 achieve sublinear results, in spite of the surprisingly large number of
252 systems with a brain-dead quadratic strstr(3).
254 ** Enhance the `regexp' and `patsubst' builtins to cache frequently used
255 regular expressions, which speeds up typical Autoconf usage.
257 ** Enhance the `format' builtin to warn for more suspicious usages, such as
258 missing arguments or problems parsing according to the format string.
260 ** Enhance the `ifelse' and `shift' builtins so that tail-recursive
261 algorithms based on `$@' operate in linear, rather than quadratic, time
264 ** A number of portability improvements inherited from gnulib.
266 * Noteworthy changes in Version 1.4.10 (2007-07-09) [stable]
267 Released by Eric Blake, based on CVS version 1.4.9c
269 ** Upgrade from GPL version 2 to GPL version 3 or later.
271 ** A number of portability improvements inherited from gnulib.
273 ** Avoid undefined behavior introduced in 1.4.9b in the `format' builtin
274 when handling %c. However, this area of code has never been documented,
275 and currently does not match the POSIX behavior of printf(1), so it may
276 have further changes in the next version.
278 * Noteworthy changes in Version 1.4.9b (2007-05-29) [beta]
279 Released by Eric Blake, based on CVS version 1.4.9a
281 ** Fix regression introduced in 1.4.9 in the `eval' builtin when performing
284 ** Fix regression introduced in 1.4.8 in the `-F' option that made it
285 impossible to freeze more than 512 kibibytes of diverted text.
287 ** The synclines option `-s' no longer generates sync lines in the middle of
288 multiline comments or quoted strings.
290 ** Work around a number of corner-case POSIX compliance bugs in various
291 broken stdio libraries. In particular, the `syscmd' builtin behaves
292 more predictably when stdin is seekable.
294 ** The `format' builtin now understands formats such as %a, %A, and %'hhd,
295 and works around a number of platform printf bugs. Furthermore, the
296 sequence format(%*.*d,-1,-1,1) no longer outputs random data. However,
297 some non-compliant platforms such as mingw still have known bugs in
298 strtod that may cause testsuite failures.
300 ** The testsuite is improved to also run gnulib portability tests for the
301 features that M4 imports from gnulib.
303 * Noteworthy changes in Version 1.4.9 (2007-03-23) [stable]
304 Released by Eric Blake, based on CVS version 1.4.8c
306 ** Minor documentation and portability cleanups.
308 * Noteworthy changes in Version 1.4.8b (2007-02-24) [beta]
309 Released by Eric Blake, based on CVS version 1.4.8a
311 ** Fix a regression introduced in 1.4.8 that made m4 unable to process
312 files larger than 2GiB on some platforms.
314 ** Fix a regression introduced in 1.4.8 that made m4 dump core when
315 invoked as 'm4 -- file'.
317 ** The `eval' builtin now follows C precedence rules. Additionally, the
318 short-circuit operators correctly short-circuit division by zero. The
319 previously undocumented alias of '=' meaning '==' in eval now triggers a
320 deprecation warning, so that a future version of M4 can implement a form
321 of variable assignment as an extension.
323 ** The `include' builtin now affects exit status on failure, as required by
324 POSIX. Use `sinclude' if you need a successful exit status.
326 ** The `-E'/`--fatal-warnings' command-line option now has two levels. When
327 specified only once, warnings affect exit status, but execution
328 continues, so that you can see all warnings instead of fixing them one
329 at a time. To achieve 1.4.8 behavior, where the first warning
330 immediately exits, specify -E twice on the command line.
332 ** A new `--warn-macro-sequence' command-line option allows detection of
333 sequences in `define' and `pushdef' definitions that match an optional
334 regular expression. The default regular expression is
335 `\$\({[^}]*}\|[0-9][0-9]+\)', corresponding to the sequences that might
336 not behave correctly when upgrading to the eventual M4 2.0. By default,
337 M4 2.0 will follow the POSIX requirement that a macro definition
338 containing `$11' must expand to the first argument concatenated with 1,
339 rather than the eleventh argument; and will take advantage of the POSIX
340 wording that allows implementations to treat `${11}' as the eleventh
341 argument instead of literal text. Be aware that Autoconf 2.61 will not
342 work with this option enabled with the default regular expression; but
343 Autoconf 2.62 will be compatible with this option.
345 ** Improved portability to platforms such as BSD/OS and AIX.
347 * Noteworthy changes in Version 1.4.8 (2006-11-20) [stable]
348 Released by Eric Blake, based on CVS version 1.4.7a
350 ** The `divert' macro and `-H'/`--hashsize' command line option no longer
351 cause a core dump when handed extra large values. Also, `divert' now
352 uses memory proportional to the number of diversions in use, rather than
353 to the maximum diversion number encountered, so that large diversion
354 numbers are less likely to exhaust system memory; and is no longer
355 limited by the maximum number of file descriptors.
357 ** The `--help' and `--version' command line options now consistently
358 override all earlier options. For example, `m4 --debugfile=trace
359 --help' now no longer accidentally creates an empty file `trace'.
361 ** The `-L'/`--nesting-limit' command line option can now be set to 0
362 to remove the default limit of 1024. However, it is still possible that
363 heavily nested input can cause abrupt program termination due to stack
366 ** Problems encountered when writing to standard error, such as with the
367 `errprint' macro, now always cause a non-zero exit status.
369 ** Warnings and errors issued during macro expansion are now consistently
370 reported at the line where the macro name was detected, rather than
371 where the close parenthesis resides. Text wrapped by `m4wrap' now
372 remembers the location that was in effect when m4wrap was invoked,
373 rather than changing to line 0 and the empty string for a file. The
374 macros `__line__' and `__file__' now work correctly even as the last
375 token in an included file.
377 ** The `builtin' and `indir' macros now transparently handle builtin
378 tokens generated by `defn'.
380 ** When diversions created by the `divert' macro collect enough text that
381 M4 must use temporary files, the environment variable $TMPDIR is now
382 consulted, and a better effort is made to clean up those files in the
383 event of a fatal signal.
385 ** The `mkstemp' builtin is added with the same GNU semantics as `maketemp',
386 based on the recommendation of POSIX to deprecate the POSIX semantics of
387 `maketemp' as inherently insecure. In GNU mode (no -G supplied on the
388 command line), `maketemp' silently retains the secure GNU semantics, but
389 a future release of M4 will change this to emit a warning. In
390 traditional mode (m4 -G), `maketemp' now uses the POSIX-mandated
391 insecure semantics, and issues a warning that you should convert your
392 script to use `mkstemp' instead. Additionally, `mkstemp' and `maketemp'
393 are now well-defined even if the template argument does not end in six
396 ** The manual has been improved, including a new section on a composite
399 ** The `changecom' and `changequote' macros now treat an empty second
400 argument the same as if it were missing, rather than using the empty
401 string and making it impossible to end a comment or quote.
403 ** The `translit' macro now operates in linear instead of quadratic time,
404 and is now eight-bit clean.
406 ** The `-D', `-U', `-s', and `-t' command line options now take effect
407 after any files encountered earlier on the command line, rather than up
408 front, as is done in traditional implementations and required by POSIX.
410 * Noteworthy changes in Version 1.4.7 (2006-09-25) [stable]
411 Released by Eric Blake, based on CVS version 1.4.6a
413 ** Fix regression from 1.4.5 in handling a file that ends in a macro
414 expansion without arguments instead of a newline.
416 ** The define and pushdef macros now warn when the first argument is not
417 a string, rather than silently doing nothing.
419 ** Standard input can now be read more than once, as in 'm4 - file -', and
420 is not closed until all wrapped text is handled. This makes a
421 difference when stdin is not a regular file, and also fixes bugs when
422 using the syscmd or esyscmd macros from wrapped text.
424 ** When standard input is a seekable file, the m4exit, syscmd, and esyscmd
425 macros now restore the current position to the next unread byte rather
426 than discarding an arbitrary amount of buffered data.
428 ** SysV command-line compatibility is no longer a goal of GNU M4; the
429 focus will be instead on POSIX compatibility. This release continues to
430 support previous usage, but adds warnings in areas which will allow a
431 future version of GNU M4 to use its own extensions without being tied to
432 the SysV command line interface.
434 ** The no-op compatibility command line options -B, -N, -S, -T, and
435 --diversions may be withdrawn or assigned new meanings in future
436 releases, so they now issue a warning if used.
438 ** A new command line option -i replaces the compatibility -e as the
439 short spelling of --interactive, for consistency with other GNU tools; a
440 warning is issued if the old spelling is used, and it may be assigned
441 new meaning in future releases.
443 ** A new command line option --debugfile replaces the options -o and
444 --error-output as the preferred spelling. The old options were
445 misleading in their names and inconsistent with other GNU tools; they
446 are still silently accepted, but no longer documented in --help, and may
447 be assigned new meanings in future releases.
449 * Noteworthy changes in Version 1.4.6 (2006-08-25) [stable]
450 Released by Eric Blake, based on CVS version 1.4.5a
452 ** Fix buffer overruns in regexp and patsubst macros when handed a trailing
453 backslash in the replacement text, or when handling \n substitutions
454 beyond the number of \(\) groups.
456 ** Fix memory leak in regexp, patsubst, and changeword macros.
458 ** The format macro now understands %F, %g, and %G.
460 ** When loading frozen files, m4 now exits with status 63 if version
461 mismatch is detected.
463 ** Fix bugs that occurred when invoked with stdout or stderr closed,
464 and detect write failures to stdout or to the target of the debugfile
465 macro. In particular, the syscmd and esyscmd macros can no longer
466 interfere with the debug stream or diversions.
468 ** The m4exit macro now converts values outside the range 0-255 to 1.
470 ** It is now an error if a command-line input file ends in the middle of a
471 comment, matching the behavior of mid-string and mid-argument
474 ** The dnl macro now warns if end of file is encountered instead of a
477 ** The error message when end of file is encountered now uses the file and
478 line where the dangling construct started, rather than `NONE:0:'.
480 ** The debugmode and __file__ macros, and the -s/--synclines option, now
481 show what directory a file was found in when the -I/--include option or
482 M4PATH variable had an effect.
484 ** The changequote and changecom macros now work with 8-bit characters, and
485 quotes and comments that begin with `(' are properly recognized
488 ** The new macro __program__ is added, which allows the input file to issue
489 an error message that resembles messages from m4. Warning and error
490 messages have been reformatted to comply with GNU Coding Standards.
492 ** The errprint, m4wrap, and shift macros are now recognized only with
495 ** The index, substr, translit, regexp, and patsubst macros now produce
496 output when given only one argument, but still warn about a missing
499 ** The patsubst macro now reliably finds zero-length matches at the end
502 * Noteworthy changes in Version 1.4.5 (2006-07-15) [stable]
503 Released by Eric Blake, based on CVS version 1.4.4c
505 ** Fix sysval on BeOS, OS/2, and other systems that store exit status
506 in the low-order byte. Additionally, on Unix platforms, if syscmd was
507 terminated by a signal, sysval now displays the signal number shifted
508 left by eight bits, to match traditional m4 implementations.
510 ** The maketemp macro is no longer subject to platform limitations (such as
511 26 or 32 max files from a given template).
513 ** Frozen files now require that the first directive be V (version), to
514 better diagnose version mismatch. Additionally, if the F directive
515 (builtin function) names an unknown builtin that existed in the m4 that
516 froze the file but not in the current m4 (for example, changeword), the
517 warning is deferred until an attempt is made to actually use the
518 builtin. This allows downgrading from beta m4-1.4o to stable m4-1.4.5
519 without breaking autoconf.
521 ** The format and indir macros are now recognized only with arguments.
523 ** The eval macro no longer crashes on x86 architectures when dividing the
524 minimum integer by -1.
526 ** On systems with ecvt and fcvt, format no longer truncates trailing
527 zeroes on integers printed with %.0f. On systems without these
528 functions, format is no longer subject to a buffer overflow that
529 permitted arbitrary code execution.
531 ** On native Windows builds, the macro __windows__ is provided instead of
532 __unix__. Likewise, on OS/2 builds, the macro __os2__ is provided.
533 This allows input files to determine when syscmd might behave
536 ** Fix bug in 1.4.3 patch to use \n line-endings that did not work for
539 ** When given the empty string or 0, undivert is now documented as a no-op
540 rather than closing stdout, warning about a non-existent file, or trying
541 to read a directory as a file.
543 ** Many documentation improvements. Also, the manual is now distributed
544 under FDL 1.2, rather than a stricter verbatim-only license.
546 ** Raise the -L (--nesting-limit) command line option limit from 250 to
549 ** The decr, incr, divert, m4exit, and substr macros treat an empty number
550 as 0, issue a warning, and expand as normal; rather than issuing an
551 error and expanding to the empty string.
553 ** The eval macro now treats an empty radix argument as 10, handles radix 1,
554 and treats the width argument as number of digits excluding the sign,
555 for compatibility with other m4 implementations.
557 ** The ifdef, divert, m4exit, substr, and translit macros now correctly
558 ignore extra arguments.
560 ** The popdef and undefine macros now correctly accept multiple arguments.
562 ** Although changeword is on its last leg, if enabled, it now reverts to the
563 default (faster) regexp when passed the empty string.
565 ** The regexp and substr macros now warn and ignore a trailing backslash in
566 the replacement, and warn on \n for n larger than the number of
567 sub-expressions in the regexp.
569 * Noteworthy changes in Version 1.4.4b (2006-06-17) [beta]
570 Released by Eric Blake, based on CVS version 1.4.4a
572 ** Fix a recursive push_string crashing bug, which affected changequote of
573 three or more characters on some compilers.
575 ** Use automake to fix build portability issues.
577 ** Fix a recursive m4wrap crashing bug.
579 ** Fix a 1 in 2**32 hash crashing bug.
581 ** Tracing a macro by name is now persistent, even if the macro is
582 subsequently undefined or redefined. The traceon and traceoff macros no
583 longer warn about undefined symbols. This solves a crash when using
584 indir on an undefined macro traced with the -t option, as well as an
585 incorrect result of ifdef. Furthermore, tracing is no longer
586 transferred with builtins, solving the bug of "m4 -tm4_eval" failing to
587 give trace output on the input
588 "define(`m4_eval',defn(`eval'))m4_eval(1)".
590 ** Fix a crash when a macro is undefined while collecting its arguments, by
591 always using the definition that was in effect before argument
592 collection. This behavior matches the C pre-processor, and means that
593 the sequence "define(`f',`1')f(define(`f',`2'))f" is now documented to
594 result in "12", rather than the previously undocumented "22".
596 ** Update the regex engine to fix several bugs.
598 ** Fix a potential crash on machines where char is signed.
600 * Noteworthy changes in Version 1.4.4 (Oct 2005) [stable]
601 Released by Gary V. Vaughan
603 ** ./configure --infodir=/usr/share/info now works correctly.
605 ** When any file named on the command line is missing exit with status 1.
607 * Noteworthy changes in Version 1.4.3 (Mar 2005) [stable]
608 Released by Gary V. Vaughan
610 ** DESTDIR installs now work correctly.
612 ** Don't segfault with uncompilable regexps to changeword().
614 ** Always use \n line-endings for frozen files (fixes a Windows bug).
616 ** Portability fix for systems lacking mkstemp(3).
618 ** Approximately 20% speed up in the common case of usage with autoconf.
620 ** Supported on QNX 6.3.
622 * Noteworthy changes in Version 1.4.2 (Aug 2004) [stable]
623 Released by Paul Eggert
625 ** No user visible changes; portability bug fixes only.
627 * Noteworthy changes in Version 1.4.1 (Jun 2004) [stable]
628 Released by Paul Eggert
630 ** The 1.4.x series is intended to be stable; features added in 1.4[a-q]
631 were not backported to 1.4.x unless specifically mentioned above.
633 ** maketemp now creates an empty file with the given name, instead of merely
634 returning the name of a nonexistent file. This closes a security hole.
637 * Version beta 1.4q - August 2001, by Gary V. Vaughan
639 ** Support for the experimental `changeword' has been dropped.
641 ** `m4 --hashsize' and `-H' are still accepted, but have no effect. M4
642 will grow its internal symbol table if the symbol density is having an
643 effect on performance.
645 ** `configure --without-modules' will build an m4 binary with no preloaded
646 modules. At startup it will search for and load modules `m4' and either
647 `gnu' or `traditional'. This mode of operation can be used for
648 development and debugging of the base modules without the need to
649 recompile all of m4 with each modification.
651 ** `configure --with-modules="gnu m4 traditional load"', for example,
652 will build an m4 binary with the named modules preloaded, ready to be
653 activated (even on static lib only machines) with the `-m' option or
654 using the `load' builtin.
656 ** M4 has no builtins or macros in core, they are all loaded from modules
657 at startup. This means that modules are no longer optional, though the
658 standard build will statically link the modules `m4', `gnu' and
659 `traditional', so even on machines with no ltdl support, all of the
660 functionality from previous releases is available.
662 ** New builtin `load' to dynamically load modules which can define new
663 builtins and user macros.
665 ** New builtin `unload' to remove loaded modules (and the builtins and user
666 macros they define) from the running m4 interpreter.
668 ** New builtins `eregexp' and `epatsubst' to use Extended Regular
669 Expressions syntax in lieu of Basic Regular Expressions as used by
670 `regexp' and `patsubst'.
672 ** The names of all currently loaded modules are returned by the new
673 builtin, ``modules''.
675 ** Loadable modules can define new builtin functions or text expansion
678 ** The module code has been rewritten to use libltdl, the libtool dynamic
679 loader, which means GNU m4 can now load (and unload) modules just about
680 anywhere which it can be built. This includes obscure hosts such as
681 cygwin and BeOS, and also on hosts which do not have shared libraries,
682 through preloading (see libtool manual) and GNU dld.
684 ** Modules can now be built without the m4 source being available using the
685 installed m4module.h header file (and some other headers that it
686 includes for you), and the installed libm4.la libtool library. All
687 symbols exported from libm4.la have a prefix of `m4_' or `M4_'. See the
688 modules directory for examples of usage.
690 ** A new V2 format for frozen files that saves module and syntax information.
692 * Version beta 1.4o - January 2000, by Rene' Seindal
694 ** Modules can be loaded from the command line with --load-module
696 ** Modules now use libtool's wrapper libltdl.
698 ** New builtin `symbols' allows dynamic queries of all currently defined
701 ** Various Bug fixes.
703 * Version beta 1.4n - November 1998, by Rene' Seindal
705 ** The module code has been reorganised yet again, and now compiles
706 correctly on GNU/Linux, HPUX 9 and 10, SunOS 5 and Solaris 5.
708 ** When configured --with-gmp a new builtin `mpeval' is now defined. The
709 builtin `eval' retains its normal behaviour.
711 ** m4 --version also shows which options were used for compilation, such as:
712 "GNU m4 1.4n (options: modules gmp changeword)"
714 ** New option --import-environment defines all environment variables as
715 macros. This is done before -D and -U are handled, so the macros can be
716 changed through these options.
718 ** Error messages now always print program name before input file name as
719 specified by GNU coding standards. Reported by Akim Demaille.
721 ** Bug fixed: "undivert(0)" could cause m4 to read standard output. A call
722 of "undivert(0)" is now silently ignored.
724 ** Bug fixed: when compiling --with-included-gettext, <libintl.h> wasn't
725 found in intl/ directory. Reported by Andrew Bettison.
727 * Version beta 1.4m - November 1998, by Rene' Seindal
729 ** Using libtool for compiling modules and for linking main app.
731 ** Reorganised the dynamic module code to encapsulate system dependencies
732 better. The code for HPUX shl_load() still needs testing and debugging.
733 A dld interface is also missing. Any volunteers?
735 ** The files from the GNU m4 web-site is now in examples/WWW as a more
736 complete example of what GNU m4 can do.
738 * Version beta 1.4l - November 1998, by Rene' Seindal
740 ** GNU m4 now has an escape syntax category. If a character is marked as
741 an escape, words are only recognised as macros if preceded by an escape
742 character. It is a bit like -P, but dynamic: it can be turned on and
743 off. The GNU m4 web-site on http://www.seindal.dk/rene/gnu/ is
744 maintained with this feature - the m4 source is available on the site.
746 ** The module interface is improved, thanks to "Brian J. Fox",
747 who has contributed some code from Meta-HTML. The modules now build
748 automatically and installs properly, by default in
749 /usr/local/libexec/m4. There is a preliminary, untested support for
752 ** There is now a __m4_version__ macro that expands to the current version
755 * Version beta 1.4k - November 1998, by Erick Branderhorst and Rene' Seindal
757 ** GNU m4 now uses gettext to support internationalization.
759 ** GNU m4 now uses automake to control Makefile.in generation. This
760 should make it more consistent with the GNU standards.
762 ** GNU m4 will use the gmp library for multiple precision integral and
763 rational arithmetic in `eval' if configured with `--with-gmp'. If
764 configured without `--with-gmp' or if gmp is not available, and the type
765 `long long int' is, GNU m4 will use that for `eval' arithmetic.
767 ** GNU m4 now parses the input according to a syntax table, that can be
768 modified through the new builtin `changesyntax'. It is a generalisation
769 of the existing builtins `changecom' and `changequote'. The changes are
770 completely backwards compatible (except for the existence of
773 ** Sync lines can be turned on and off with the `syncoutput' builtin. The
774 builtin `syncoutput' is a GNU extension.
776 ** New experimental feature: dynamically loadable modules. New builtin
777 `loadmodules' loads shared libraries, that can define new builtin
778 macros, ie, new macros can be written in C. Depends on the dlopen()
779 interface, and is currently only tested on Linux. Enabled at configure
780 time with `--with-modules'. Documentation is in src/module.c and
783 ** Implement a GNU message catalog for French (Franc,ois Pinard).
785 ** Filenames found through path searches are now correctly reflected in
786 error and debug messages and through the `__file__' macro.
790 *** All 8-bit characters can now be used for quotes.
792 * Version 1.4 - October 1994, by Franc,ois Pinard
794 ** (No user visible changes)
796 * Version 1.3 - September 1994, by Franc,ois Pinard
798 ** Diversions are created as needed. Option `-N' is still accepted, but
799 otherwise ignored. Users should use only negative diversion numbers,
800 instead of high positive numbers, for diverting to nowhere.
802 ** Diversions should also work faster. No temporary files will be needed
803 at all if all diversions taken altogether do not use more than 512K.
805 ** Frozen state files may be produced with the `--freeze-state' (-F)
806 option and later brought back through the `--reload-state' (-R) option.
808 * Version 1.2 - July 1994, by Franc,ois Pinard
810 ** In patsubst(STRING, REGEXP, REPLACEMENT), \& in REPLACEMENT has been
811 changed to represent this part of STRING matched by the whole REGEXP,
812 instead of the whole STRING as before. \0 does the same, but emits a
813 diagnostic saying it will disappear in some subsequent release.
815 ** eval(EXPR) emits a diagnostic if EXPR has suffixed crumb. The same for
816 other numeric conversions in incr(), decr(), divert(), etc.
818 ** `--fatal-warnings' (-E) stops execution at first warning.
820 ** `--nesting-limit=LEVEL' (-L LEVEL) sets a limit to macro nesting.
821 It is initially fixed at 250.
823 ** `--word-regexp=REGEXP' (-W REGEXP) modifies macro name syntax, like
824 does the new `changeword(REGEXP)' macro. This feature is experimental,
825 tell me your opinions about it. You do need --enable-changeword at
826 configure time to get these things. Do *not* depend on them yet.
828 ** Trace output format is scannable by GNU Emacs' next-error function.
830 ** Stack overflow is detected and diagnosed on some capable systems.
832 ** Various bugs have been corrected, m4 should be more portable. See the
833 ChangeLog for details.
835 * Version 1.1 - November 1993, by Franc,ois Pinard
837 ** Changes which might affect existing GNU m4 scripts:
839 *** Option `-V' has been removed, use `--version' instead. `--version'
840 writes on standard output instead of standard error, and inhibits any
843 *** `--no-gnu-extensions' has been renamed `--traditional'.
845 *** In `eval', `^' used to indicate exponentiation, use `**' instead.
847 *** The automatic undiversion which takes place at end of all input is
848 forced into the main output stream.
850 ** Changes which are unlikely to affect existing scripts:
852 *** `--help' prints an usage summary on standard output. Script execution
855 *** `--prefix-builtins' (-P) prefixes all builtin macros by `m4_'.
857 *** Most builtin macros for which arguments are mandatory, called without
858 any arguments, are no more recognized as builtin macros: they are
859 consequently copied verbatim to the output stream.
861 *** `define' and `pushdef' are usable with only one argument, they give
862 this argument an empty definition.
864 *** `eval' new operators for binary representation handling: `^' for
865 exclusive-or, `~' for the bitwise negation, `<<' and `>>' for shifts.
867 *** `eval' recognizes the notation 0bDIGITS for binary numbers and the
868 notation 0rRADIX:DIGITS for numbers in any radix from 1 to 36.
870 * Version 1.0.3 - December 1992, by Franc,ois Pinard
872 ** Changes for the user:
874 *** `dnl' outputs a diagnostic if immediately followed by `('. Usually,
875 `dnl' is followed by newline or whitespace.
877 *** `ifelse' accepts without complaining the common idiom of having only
878 one argument. This is useful for introducing long comments.
880 *** `eval' always expresses values as signed, whatever the radix.
882 *** M4OPTS environment variable is no longer obeyed.
884 *** `--no-warnings' option is renamed `--silent'.
886 *** Debug lines use a new format more compatible with GNU standards.
888 *** Various bugs have been corrected. See the ChangeLog for details.
890 ** Changes for the installer:
892 *** GNU m4 now uses an Autoconf-generated configure script, and should be
893 more easily portable in many ways. (Cray is not supported yet).
895 *** `make check' has been made more portable, expect no errors.
897 ** Changes for the programmer:
899 *** Sources have been fully reindented to comply with GNU standards, and
900 cleaned up in many ways.
902 *** Sources have been protoized. Non-ANSI compilers are automatically
903 detected, then sources are unprotoized on the fly before compilation.
905 *** GNU m4 uses newer versions of obstack, regex, getopt, etc.
907 * Version 1.0 - October 1991, by Rene' Seindal
909 ** Uses GNU configure, taken from the gdb distribution.
911 ** Uses GNU getopt(), with long option names.
913 ** The -Q/+quiet option is added, which suppresses warnings about missing
914 or superflous arguments to builtin macros.
916 ** Added default options via the M4OPTS environment variable.
918 ** Several minor bugs have been fixed.
920 * Version 0.99 - July 1991, by Rene' Seindal
922 ** The builtins `incr' and `decr' are now implemented without use of
925 ** The builtin `indir' is added, to allow for indirect macro calls
926 (allows use of "illegal" macro names).
928 ** The debugging and tracing facilities has been enhanced considerably.
929 See the manual for details.
931 ** The -tMACRO option is added, marks MACRO for tracing as soon as it
934 ** Builtins are traced after renaming iff they were before.
936 ** Named files can now be undiverted.
938 ** The -Nnum option can be used to increase the number of divertions
941 ** Calling changecom without arguments now disables all comment handling.
943 ** A bug in `dnl' is fixed.
945 ** A bug in the multi-character quoting code is fixed.
947 ** Several typos in the manual has been corrected. More probably persist.
949 * Version 0.75 - November 1990, by Rene' Seindal
951 ** Implemented search path for include files (-I option and M4PATH
952 environment variable).
954 ** Implemented builtin `format' for printf-like formatting.
956 ** Implemented builtin `regexp' for searching for regular expressions.
958 ** Implemented builtin `patsubst' for substitution with regular
961 ** Implemented builtin `esyscmd', which expands to a shell commands output.
963 ** Implemented `__file__' and `__line__' for use in error messages.
965 ** Implemented character ranges in `translit'.
967 ** Implemented control over debugging output.
969 ** Implemented multi-character quotes.
971 ** Implemented multi-character comment delimiters.
973 ** Changed predefined macro `gnu' to `__gnu__'.
975 ** Changed predefined macro `unix' to `__unix__', when the -G option is
976 not used. With -G, `unix' is still defined.
978 ** Added program name to error messages.
980 ** Fixed two missing null bytes bugs.
982 * Version 0.50 - January 1990, by Rene' Seindal
984 * Initial beta release.