This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/62024] __atomic_always_lock_free is not a constant expression


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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]