This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116c. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-03-27


3014. Comma-delimited vs. comma-separated output for #embed

Section: 15.4.1  [cpp.embed.gen]     Status: open     Submitter: Hubert Tong     Date: 2025-02-15

Subclause 15.4.1 [cpp.embed.gen] paragraph 7 specifies "comma-delimited" output for #embed. However, that allows for a trailing comma that is undesirable.

Possible resolution:

Change in 15.4.1 [cpp.embed.gen] paragraph 7 and paragraph 8 as follows:

The #embed directive is replaced by a comma-delimited comma-separated list of integer literals of type int, unless otherwise modified by embed parameters (15.4.2 [cpp.embed.param]).

The integer literals in the comma-delimited comma-separated list correspond to resource-count consecutive calls to std::fgetc (31.13.1 [cstdio.syn]) from the resource, as a binary file. If any call to std::fgetc returns EOF, the program is ill-formed.