This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/62024] __atomic_always_lock_free is not a constant expression
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 14 Aug 2014 15:00:10 +0000
- Subject: [Bug c/62024] __atomic_always_lock_free is not a constant expression
- Auto-submitted: auto-generated
- References: <bug-62024-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62024
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to joseph@codesourcery.com from comment #4)
> Whatever we do for __atomic_always_lock_free, note that we'll probably
> need to find some way for ATOMIC_*_LOCK_FREE (in stdatomic.h) to expand
> to something usable in #if.
>
> http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_458.htm
Couldn't we just map ATOMIC_*_LOCK_FREE macros (in stdatomic.h) to
__GCC_ATOMIC_*_LOCK_FREE macros defined in c-cppbuiltin.c:cpp_atomic_builtins?
FWIW, libsupc++ does exactly that. If this approach makes sense, I can prepare
a patch with testcase(s).