Page MenuHomePhabricator

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

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

Details

Summary

_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.Thu, Mar 5, 6:39 PM

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

$ clang --version
clang version 11.0.0 (https://github.com/llvm/llvm-project.git 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.Thu, Mar 5, 8:18 PM