bug 205453: another buildworld failure that shows up for powerpc64 lib32 contexts

Mark Millard markmi at dsl-only.net
Sun Dec 20 08:33:48 UTC 2015


I have submitted bug 205453: another buildworld failure that shows up for powerpc64 lib32 contexts.

But in this case I submitted against the Base System for sys/cdefs.h and/or libcxxrt/guard.cc problems in using/handling C11's _Static_assert.

You may want to look and see if you expect it should instead be attributed to the various g++ compilers (g++49, g++5, powerpc64-portbld-freebsd11.0-g++, . . .). A simple 6 line program source shows the g++ syntax error issue with a direct use of _Static_assert. (See the bug.) As I understand C++ the rejections are valid/allowed.

gcc49, gcc5, powerpc64-portbld-freebsd11.0-gcc, . . . accept the same C11 _Static_assert notation fine when compiling the same source file content as C code. clang++ (3.7) accepts the C11 _Static_assert syntax in C++ compiles.

But:

# clang++ -Wall -pedantic main.cc
main.cc:2:1: warning: _Static_assert is a C11-specific feature [-Wc11-extensions]
_Static_assert(1,"Test");
^
1 warning generated.

In the buildworld case the reason for lib32's -m32 compiles being involved is #if/#elif/. . . structure for non-__arm__/non-_LP64/non-__LITTLE_ENDIAN__ contexts being the only ones to attempt to use C11's _Static_assert in libcxxrt/guard.cc's C++ source code:

#ifdef __arm__
. . .
#elif defined(_LP64)
. . .
#else
typedef uint32_t guard_lock_t;
#       if defined(__LITTLE_ENDIAN__)
. . .
#       else
typedef struct {
        uint32_t init_half;
        uint32_t lock_half;
} guard_t;
_Static_assert(sizeof(guard_t) == sizeof(uint64_t), "");
. . .
#       endif
. . .
#endif

===
Mark Millard
markmi at dsl-only.net




More information about the freebsd-ppc mailing list