This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/81358] libatomic not automatically linked with C11 code
- From: "jeff.science at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 10 Jul 2017 17:56:18 +0000
- Subject: [Bug driver/81358] libatomic not automatically linked with C11 code
- Auto-submitted: auto-generated
- References: <bug-81358-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
--- Comment #5 from Jeff Hammond <jeff.science at gmail dot com> ---
Indeed, _Atomic is a language keyword and doesn't require any headers (the
inclusion of stdatomic.h in this code is superfluous), so the "header->explicit
library" argument doesn't apply.
In any case, I do not see why language intrinsics that require headers should
require libraries. Why is sqrt() from math.h different from fprintf() from
stdio.h? Maybe POSIX requires that, but ISO C11 doesn't, and I'm using
-std=c11 not -std=posix.
--as-needed would greatly enhance user experience for both this and libm.