https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205453

Dimitry Andric <d...@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b...@freebsd.org,
                   |                            |d...@freebsd.org,
                   |                            |thera...@freebsd.org

--- Comment #2 from Dimitry Andric <d...@freebsd.org> ---
Hm, this _Static_assert has an interesting history.  The original review from
Baptiste, https://reviews.freebsd.org/D1390, used static_assert(), but this
required -std=c++11 to compile, otherwise you would get:

contrib/libcxxrt/guard.cc:104:1: error: C++ requires a type specifier for all
declarations
static_assert(sizeof(guard_t) == sizeof(uint64_t), "");
^~~~~~~~~~~~~

This is the version upstream eventually also used, since they apparently assume
C++11 there.  David suggested changing it to _Static_assert(): "This should
work if you change it to _Static_assert, which I think we support for all C/C++
versions."

Now that I look at the code again, I am not entirely sure why the static
assertion is only for the big endian #ifdef block.  It would seem more useful
to put it a few lines lower, for the !_LP64 case.

That said, even when moving the _Static_assert() like that, it compiles fine
for me, both with base gcc, and several versions of ports gcc (I tried gcc 4.8,
4.9 and 5.2).

On the other hand, your sample program indeed does not compile with the ports
versions of gcc.  I'm not sure where those versions are getting their version
of _Static_assert() from, though...

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"

Reply via email to