[llvm-bugs] [Bug 32479] Libcxx requires GNU extension when compiling with newlib

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 18 21:38:20 PDT 2017


http://bugs.llvm.org/show_bug.cgi?id=32479

Eric Fiselier <eric at efcs.ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |eric at efcs.ca
         Resolution|---                         |WONTFIX

--- Comment #5 from Eric Fiselier <eric at efcs.ca> ---
> I guess that's up to you guys if you want Libc++ to be POSIX compliant or 
> not with newlib. Adding that macro is easy enough for our use case, but I'm 
> not sure that everyone can turn GNU extensions on (especially since they are 
> likely using Clang to avoid GCC). 

On all supported platforms Clang pre-defines `_GNU_SOURCE=1` to enable GNU
extensions by default when compiling C++. The extensions are needed to provide
a correct implementation of `locale` and input/output among other things.

Both libc++ and libstdc++ are dependent on this behavior and have been for
years. Using libc extensions allows libc++ to offer a better QoI than it could
otherwise. I don't have any motivation to try and change this. As long as libc
extensions are available libc++ should expect the compiler to enable them by
default. 

> It would also suggest that gnu++XXX should be used instead of std++XXX which 
> seems odd for a C++ library as a requirement.

I think you're confusing GLIBC extensions with GCC extensions. `-std=gnu++XX`
changes the language dialect. It should have no effect on what GLIBC offers.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170419/a27600e8/attachment.html>


More information about the llvm-bugs mailing list