https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108734

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to David Edelsohn from comment #5)
> __has_builtin() does not mean that the builtin is inlined.  It only means
> that GCC recognizes the builtin.  That is how __has_builtin() is documented.
> In 32 bit mode, GCC emits an external reference for the builtin: 8 byte
> atomic requires libatomic library, which is not linked by default (and
> shouldn't be).

And this is consistent with e.g. __has_builtin(__builtin_strlen). The fact that
GCC recognizes the token "__builtin_strlen" doesn't mean that you don't need an
extern definition of strlen for cases where the built-in isn't inlined. It's
just that for the atomic built-ins the name of the built-in is the same as the
name of the extern function that might be used.

Reply via email to