groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: macOS 12.6.3, static_assert, and vasnprintf compilation failure


From: Alejandro Colomar
Subject: Re: macOS 12.6.3, static_assert, and vasnprintf compilation failure
Date: Tue, 7 Feb 2023 15:20:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1

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.

+1

I 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_next

Note 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

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]