[committed] libstdc++: Only use __builtin_sprintf if supported [PR 96083]
Martin Sebor
msebor@gmail.com
Wed Dec 16 16:23:37 GMT 2020
On 12/16/20 8:00 AM, Jonathan Wakely via Gcc-patches wrote:
> Clang doesn't support __builtin_sprintf, so use std::sprintf instead.
>
> libstdc++-v3/ChangeLog:
>
> PR libstdc++/96083
> * include/ext/throw_allocator.h: Use __has_builtin to check for
> __builtin_sprintf support, and use std::sprtinf if necessary.
>
> Tested powerpc64le-linux. Committed to trunk.
>
I expected to see the test itself guarded by #ifdef __has_builtin
like in <utility>. Or is this code only [meant to be] used with
compilers that understand __has_builtin? (I'm mostly just curious
here about support for other compilers like ICC, not necessarily
pointing out a problem with the patch.)
Martin
More information about the Libstdc++
mailing list