Page MenuHomePhabricator

[libc] [NFC] Remove -Wc11-extensions warning

Authored by abrachet on Mar 5 2020, 6:39 PM.



_Atomic is not an official C++ keyword, when -pedantic is specified the compiler gives a warning about its usage.

This patch uses <stdatomic.h> and it's atomic_uint_least32_t. Unfortunately there is no atomic_uint32_t. This works because <stdatomic.h> is a system header which isn't subject to the same warnings. Alternatively we could add #pragma GCC system_header to thread_utils.h.

Diff Detail

Event Timeline

abrachet created this revision.Mar 5 2020, 6:39 PM

It's worth mentioning compiler version I was getting this warning on.

$ clang --version
clang version 11.0.0 ( 6d2372ce584f0fd26575e31d63278b98be2cfa1c)

I will fix this separately as I am going to revert the original patch shortly. It is failing on the bots.

abrachet abandoned this revision.Mar 5 2020, 8:18 PM