Bruno Haible <[email protected]> writes:

> The patch is not right: It assumes that AH_BOTTOM inserts a newline
> after the given text. But this is not documented, therefore not guaranteed
> to always happen. Therefore we might end up with garbage after the
> '#endif', in the same line.

I highly doubt that Autoconf would change that behavior, since they
should want config.h to end with a newline. From C23 § 5.1.1.2:

    A source file that is not empty shall end in a new-line character,
    which shall not be immediately preceded by a backslash character
    before any such splicing takes place.

Along with POSIX's definition of line, from § 3.185 [1]:

    A sequence of zero or more non-<newline> characters plus a
    terminating <newline> character.
    
In practice, I would hope that no compiler actually breaks because of a
missing newline at the end of the file. But it is probably something
Autoconf cares about.

> Let me fix that in a better way.

Regardless that patch looks good to me. Most of the standardized headers
have *_h.m4 files to keep the configure.ac section of the module
description small and organized.

Thanks,
Collin

[1] https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html

Reply via email to