N1534 Updates to Character Constants

Nick Stoughton
2010-11-04

Background

The Austin Group, responsible for the maintenance of ISO/IEC 9945 POSIX, are making updates to the POSIX shell to support strings that are very similar to C character string literals. However, they are proposing to add two additional backslash escape sequences, namely \e to mean the Escape character in the current locale, and \cx to mean "Control-x".

This paper is intended to propose a documented future direction for the C standard to align with this POSIX proposal, since such characters have been shown to be useful in existing practice within shells, and are somewhat more complex to do in a portable fashion by existing mechanisms.

Description

The character display semantics described in C1x section 5.2.2 includes a list of the backslash escape sequences currently supported. It is felt to be too far reaching to update this list directly (particularly with respect to C++ overlap) so this proposal instead merely gives notice that a future revision of the standard might use these characters for this purpose.

Specific Wording Changes

Change in 6.11.4; add a new paragraph:
The following characters are used in other standards, and are reserved for the same purpose in this standard:
\cx The character representing "CONTROL-x", where x is a single character
\e The escape character