Doc. No.: P1258R0
Date: 2018-10-08
Reply to: Detlef Vollmann, dv@vollmann.ch
Audience: SG1, LEWG, WG21

Don't Make C++ Unimplementable On Small CPUs

Freestanding implementations were originally introduced to provide a language only implementation plus "certain language-support libraries" for small systems that don't have and don't need an underlying operating system.

This allows vendors to provide a "compiler-only" implementation of C++ for such systems.

At the Rapperwil meeting SG1 and LEWG decided to make at least one lock-free atomic integer type mandatory even in freestanding implementations. This requires that there's a lock-free compare_exchange. Implementing such a type on CPU architectures that don't provide a respective machine instruction without OS support is very problematic.

WG21 should be very careful to just assume that modern platforms will provide such machine instructions. E.g. ARM Cortex M0 and M0+ don't provide such instructions and are pretty modern.

Before WG21 decides on requirements for freestanding implementations, WG21 should be very sure that the requirements really don't cause implementation issues.

So please come back the the decision in Rapperswil and make the lock-free atomic integer type optional again.