Hi all, On 2/7/23 02:06, Bruno Haible wrote:
Hi Branden,A problem immediately arose on macOS 12.6.3. It's our good friend vasnprintf again. Logs are available on Savannah[2]. lib/vasnprintf.c:411:16: error: expected parameter declarator static_assert (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS); ^ lib/vasnprintf.c:411:16: error: expected ')' lib/vasnprintf.c:411:15: note: to match this '(' static_assert (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS); ^ lib/vasnprintf.c:411:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] static_assert (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS); ^ lib/vasnprintf.c:415:16: error: expected parameter declarator static_assert (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS); ^ lib/vasnprintf.c:415:16: error: expected ')' lib/vasnprintf.c:415:15: note: to match this '(' static_assert (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS); ^ lib/vasnprintf.c:415:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] static_assert (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS); ^I can reproduce the issue on a macOS 12.5 machine (gcc104.fsffrance.org — you can surely get an account there too). The command $ make lib/vasnprintf.o V=1 shows me the compiler command line that failed: depbase=`echo lib/vasnprintf.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ cc -DHAVE_CONFIG_H -I. -I.. -I./src/include -I../src/include -I../lib -I./src/include -I./lib -I/Users/haible/include -Wall -g -O2 -MT lib/vasnprintf.o -MD -MP -MF $depbase.Tpo -c -o lib/vasnprintf.o ../lib/vasnprintf.c &&\ mv -f $depbase.Tpo $depbase.Po ...
I don't know if groff is supposed to be compatible with non-GNU compilers, or if it has a dependency to GNU C compilers (GCC, Clang, and maybe others). If you require GNU C, maybe you should use -iquote in some places to clarify that quote includes should be one thing and bracket includes come from a different place.
Regardless of that, I took practice of having headers in a root directory with the name of the project (.../include/groff/...), so that then you always include them as `#include "groff/foo.h"` and there's no possible confussion, even if you have to use -I for compatibility with other compilers.
Cheers, Alex -- <http://www.alejandro-colomar.es/> GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
OpenPGP_signature
Description: OpenPGP digital signature