Why does g++ still require -latomic

后端 未结 3 634
粉色の甜心
粉色の甜心 2020-12-18 22:00

In 29.5 Atomic types of the C++ Standard November 2014 working draft it states:

  1. There is a generic class template atomic. The type of
3条回答
  •  醉梦人生
    2020-12-18 22:39

    I know that the standard doesn't say anything about compiler flags or libraries that have to be included

    Right.

    but so far I thought that any standard conformant, single file code can be compiled via the first command.

    Well, no. As you just said, there is no particular reason to assume this. Consider also that GCC extensions are enabled by default.

    That being said, it seems self-evident that the intention is to make -latomic a default part of the runtime when it's settled down a bit.

提交回复
热议问题