Hi Bruno and Branden, On 2/7/23 15:13, Bruno Haible wrote:
G. Branden Robinson wrote:groff's had an assert.h header since version 1.01 (1991), but I don't know why. In 2020 I expanded it to support C99-style assertions (i.e., assertions that communicate meaning instead of the nearly useless form from C89). I am trying to not require C99 features; we can do without variable-length arrays and complex numbers. But as a developer I insist on C99 assertions.The Gnulib manual [1] explains that Gnulib essentially assumes C99 already. I still have access to a machine with a pre-C99 compiler, but I don't use it for testing any more, since there's no point in using a 20-years old compiler that would barf on 50% of the source files.
+1I suggest declaring C89 a unsupported language version, and requiring a minimum of C99 (if not C11). I worked on upgrading shadow-utils recently from C89 to C11, so I may help if you need some help.
<https://github.com/shadow-maint/shadow/issues/600>
We haven't tested the behaviour of <assert.h> in detail, but you're *very* likely to get the C99 assertions that you want everywhere.might require #include_nextNote that #include_next requires GCC or clang. So it is much more of a portability constraint than merely requiring C99 or newer. Therefore: - How about removing groff's src/include/assert.h and just rely on the one from the system?
+1
- If that does not work out, how about putting the src/include/assert.h into a different directory and adjust the -I options, so that the Gnulib compilation units will not see it? Only the groff C++ code would see it.
Yep, I suggest using src/include/groff/ as a root for all groff includes, and use -I src/include, so that you need to include groff's headers as "groff/...", which can't collide with anything else.
Cheers, Alex
Bruno [1] <https://www.gnu.org/software/gnulib/manual/html_node/Portability-guidelines.html>
-- <http://www.alejandro-colomar.es/> GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
OpenPGP_signature
Description: OpenPGP digital signature