Re: clang++ 11 compilation issues

2021-01-14 Thread Alexandre Duret-Lutz
Bruno Haible writes: > You are supposed to choose the warnings that are reasonable for your > project. For some project of mine, I had to disable 20-40 warning options > before I could get reasonable output. That's exactly what I did :-) The set of warnings enabled in those commands is the

Re: clang++ 11 compilation issues

2021-01-13 Thread Bruno Haible
Paul Eggert wrote: > How about the attached, more-conservative patch instead? It limits > __cpp_static_assert to controlling the use of 'static_assert', and > causes C++ code to not use _Static_assert at all. This one looks good. I agree that most C++ compilers have or will have

Re: clang++ 11 compilation issues

2021-01-13 Thread Paul Eggert
On 1/13/21 5:21 PM, Bruno Haible wrote: For example, say, someone use g++ version >= 5 with option -std=c++98. Then, with your new code, __cpp_static_assert will be undefined, _GL_HAVE__STATIC_ASSERT will be 1, and _GL_VERIFY(R, DIAGNOSTIC, ...) will expand to _Static_assert (R, DIAGNOSTIC)

Re: clang++ 11 compilation issues

2021-01-13 Thread Bruno Haible
Hi Paul, > Also, looking over the current verify.h, it's a little complicated and I > doubt whether the complexity is worth it nowadays. How about if we > simplify the C++ case, by simply relying on __cpp_static_assert there? > Although this could miss opportunities for generating diagnostics

Re: clang++ 11 compilation issues

2021-01-13 Thread Paul Eggert
On 1/12/21 12:19 PM, Bruno Haible wrote: Those macros check for __cpp_static_assert to assume something about _Static_assert, which seems dubious. Paul can tell more about this one. I agree it's dubious. Also, looking over the current verify.h, it's a little complicated and I doubt whether

Re: clang++ 11 compilation issues

2021-01-13 Thread Jeffrey Walton
On Tue, Jan 12, 2021 at 3:19 PM Bruno Haible wrote: > > Hi Alexandre, > > > I'm upgrading a project that used a 8-month-old copy of gnulib to > > today's version > > Since then, gnulib has improved its support for clang. > > > I compile with -Werror. > > Gnulib generally does not support -Werror

Re: clang++ 11 compilation issues

2021-01-13 Thread Alexandre Duret-Lutz
Florian Weimer writes: > Would you be able to check whether __null is in the preprocessed > sources? If it is there (and the lack of further logged expansions > suggests this), then this is a compiler bug. __null is not zero, and > should be fine to use as a null pointer constant. This is why

Re: clang++ 11 compilation issues

2021-01-12 Thread Bruno Haible
Hi Alexandre, > I'm upgrading a project that used a 8-month-old copy of gnulib to > today's version Since then, gnulib has improved its support for clang. > I compile with -Werror. Gnulib generally does not support -Werror on arbitrary platforms. We try to make for a warning-free compilation

Re: clang++ 11 compilation issues

2021-01-12 Thread Florian Weimer
* Alexandre Duret-Lutz: > (1) lib/argmatch.h includes lib/gettext.h which fails as follows > >> clang++ -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../buddy/src -I../lib -I../lib >> -W -Wall -Werror -Wint-to-void-pointer-cast -Wzero-as-null-pointer-constant >> -Wcast-align -Wpointer-arith