input file ends with non-newline
Douglas McIlroy <[email protected]> Fri, 6 Dec 2024 17:33:09 -0500
| Newsgroups | gmane.comp.gnu.m4.general |
|---|---|
| Message-ID | <CAKH6PiWUZs35srn0tdo0+yL4n3JZtvXE0uXj6+mduV9uXOyxnw@mail.gmail.com> |
Arguments are collected if a macro name is "immediately" followed by a left parenthesis. Experiment shows that arguments are not collected when a macro name occurs at the end of a file (without a following newline) and the next input file begins with a left parenthesis. I believe this behavior is incorrect. However, the underlying error lies not with m4, but with the input file. According to POSIX, a valid nonempty text file must end with a newline. Other experiment suggests that m4 silently appends a missing newline. Should it not warn when it does so? Doug