Source-Changes-D archive

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

Re: CVS commit: src/include



On Thu, May 23, 2019 at 09:05:00AM +0200, Martin Husemann wrote:
> On Thu, May 23, 2019 at 12:03:33AM +0200, Kamil Rytarowski wrote:
> > >> -#if ((__cplusplus - 0) < 201103L)
> > >> +#if defined(_ISOC11_SOURCE) || (__STDC_VERSION__ - 0) >= 201101L
> 
> Am I missing something or does this (in addition to the intended change)
> make the macro invisible for C++ compilations? Is that intended? If so,
> shouldn't it be explained in the log message?
> 
> Martin

Per the standards:
static_assert / _Static_assert is meaningful for >=C11
static_assert is meaningful for >=C++11

 >= C++11	: handled by libstdc++ / libc++
 >= C11		: handled by us, in this case and before.

Should it mean something for:
 < C++11
 < C11

The older version attempted to provide < C++11 and < C11 static_assert,
too.

This is causing problems because g++ does not provide _Static_assert in
the case of building older C++ code.

Kamil argued you should just not use it if it doesn't work.
My argument was that we shouldn't provide a broken definition.

The code from the bug report did:
#if defined(static_assert)
.. fallback definition ..
#endif

I think it is reasonable for this to work.

We can probably keep providing it for all C standards, I guess. that was
the "that's so solaris" argument. GCC does not cause problems with that.


Home | Main Index | Thread Index | Old Index