Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’

2022-12-28 Thread Paul Eggert
On 9/14/22 04:35, Bruno Haible wrote: -# define _Static_assert(...) \ - _GL_VERIFY (__VA_ARGS__, "static assertion failed", -) +# define _Static_assert(R, ...) \ + _GL_VERIFY ((R), "static assertion failed", -) Unfortunately this doesn't conform to strict C99, which requires the

Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’

2022-09-14 Thread Bruno Haible
Paul Eggert wrote: > Where it’s easy, prefer ‘static_assert’ to ‘verify’, In a build of GNU gettext, with clang and the MSVC header files, I get errors starting like this: /bin/sh ./libtool --tag=CXX --mode=compile /home/bruno/msvc/compile clang-cl -ferror-limit=0 -DIN_LIBASPRINTF

Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’

2022-09-14 Thread Bruno Haible
> > Where it’s easy, prefer ‘static_assert’ to ‘verify’, > > Compiling a current GNU gettext with MSVC 14, I get this compilation error: I got this working, by using preprocessor tricks, inspired by

Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’

2022-09-14 Thread Bruno Haible
Paul Eggert wrote: > Where it’s easy, prefer ‘static_assert’ to ‘verify’, Compiling a current GNU gettext with MSVC 14, I get this compilation error: libtool: compile: /home/bruno/msvc/compile cl -nologo -DIN_LIBASPRINTF -DHAVE_CONFIG_H -D__USE_MINGW_ANSI_STDIO=0 -I.

Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’

2022-09-14 Thread Bruno Haible
Paul Eggert wrote: > Where it’s easy, prefer ‘static_assert’ to ‘verify’, On MSVC 14, in C mode, I get compilation errors: ...\gnulib-tests\test-assert.c(27): warning C4116: unnamed type definition in parentheses ...\gnulib-tests\test-assert.c(27): error C2057: expected constant expression

Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’

2022-09-14 Thread Bruno Haible
Paul Eggert wrote: > > # if (!defined static_assert \ > > - && __STDC_VERSION__ < 202311 && __cpp_static_assert < 201411) > > + && __STDC_VERSION__ < 202311 \ > > + && __cpp_static_assert < 201411 && __GNUG__ < 6) > > # define static_assert _Static_assert /* C11 requires this

Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’

2022-09-13 Thread Paul Eggert
On 9/13/22 20:05, Bruno Haible wrote: # if (!defined static_assert \ - && __STDC_VERSION__ < 202311 && __cpp_static_assert < 201411) + && __STDC_VERSION__ < 202311 \ + && __cpp_static_assert < 201411 && __GNUG__ < 6) # define static_assert _Static_assert /* C11 requires this

Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’

2022-09-13 Thread Bruno Haible
Paul Eggert wrote: > Where it’s easy, prefer ‘static_assert’ to ‘verify’, Compiling a current GNU gettext with these patches on Cygwin and mingw I get a compilation error: /bin/sh ./libtool --tag=CXX --mode=compile x86_64-pc-cygwin-g++ -DIN_LIBASPRINTF -DHAVE_CONFIG_H

[PROPOSED 2/2] assert-h: prefer to ‘verify’

2022-09-12 Thread Paul Eggert
Where it’s easy, prefer ‘static_assert’ to ‘verify’, as this simplifies the source by removing the need to include verify.h. Keep using ‘verify’ if verify.h is used for other reasons, or if code is shared with glibc. * lib/alignalloc.c, lib/argmatch.h, lib/c32is-impl.h: * lib/c32snrtombs.c,