cplusplus / nbballot

Handling of NB comments in response to ballots
14 stars 4 forks source link

US 30-072 15.11 [cpp.predefined] Predefined macros from the C library #502

Closed wg21bot closed 1 year ago

wg21bot commented 1 year ago

When importing the standard library using import std; or import std.all;, none of the macros from the C standard library are imported. A better integration is desired, see (pending) paper P2654 for more details of the whole problem space and proposals for C++26, but make the minimal changes appropriate for C++23.

Proposed change:

Add the following macros to the list of compiler predefined macros, and remove them from the corresponding C headers (in the C++ standard):

define __bool_true_false_are_defined 1

define __alignas_is_defined 1

define __alignof_is_defined 1

jwakely commented 1 year ago

A comment from the UK NB suggests deprecating these as they're obsolescent in C2x.

jfbastien commented 1 year ago

Paper P2654 doesn't exist at the moment.

GB issues:

They're assigned to LEWG, so I'll move this comment to LEWG as well. Please re-assign to EWG if the macro aren't deprecated.

brycelelbach commented 1 year ago

The proposed resolution is a paper that does not exist right now.

AaronBallman commented 1 year ago

A comment from the UK NB suggests deprecating these as they're obsolescent in C2x.

Minor correction: __bool_true_false_are_defined is obsolescent, the other two were outright removed in C2x (no idea if someone will file an NB comment asking for them to come back; if I see one, I'll report back).

brycelelbach commented 1 year ago

The paper does exist, I just failed to check for a D paper. https://wg21.link/D2654R0

brycelelbach commented 1 year ago

2022-11-07 13:00 to 15:00 UTC-10 Kona Library Evolution Meeting

US-30-072: Predefined macros from the C library

2022-11-07 13:00 to 15:00 UTC-10 Kona Library Evolution Minutes

Champion: Alisdair Meredith (in-person)

Chair: Fabio Fracassi & Billy Baker

Minute Taker: Steve Downey

POLL: Adopt the proposed resolution from the NB comment US 30–72: adding C Macros as “feature test” macros for C++23

SF F N A SA
2 2 7 8 1

Attendance: 18 (in-person) + 8 (remote)

# of Authors: 1

Author’s position: SF

Outcome: No consensus in favor

Summary

The problem solution has some merit, but the problem seems to be rare enough, and has a readily available workaround.

Next Steps

Take a Library Evolution electronic poll to reject C++23 NB comment US-30-72 (Predefined macros from the C Library).

brycelelbach commented 1 year ago

2022-11 Library Evolution Electronic Poll Outcomes

Poll 1.15: Reject C++23 National Body comment US-30-072 Predefined Macros From The C Library and any duplicate comments.

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
12 4 1 2 1

Outcome: Consensus in favor.

jensmaurer commented 1 year ago

There was no consensus for a change.