Title
Deprecate <stdalign.h> and <stdalign.h> macros
Status
lewg
Section
[stdalign.h.syn],[stdbool.h.syn]
Submitter
GB

Created on 2022-11-10.00:00:00 last changed 3 weeks ago

Messages

Date: 2022-11-11.18:12:06

Proposed resolution:

This wording is relative to N4917.

  1. Modify [stdalign.h.syn] as indicated:

    17.14.4 Header <stdalign.h> synopsis [stdalign.h.syn]

    #define __alignas_is_defined 1
    

    -1- The contents of the C++ header <stdalign.h> are the same as the C standard library header <stdalign.h>, with the following changes: The header <stdalign.h> does not define a macro named alignas. The macro __alignas_is_defined ([depr.c.macros]) is deprecated.

    See also: ISO C 7.15

  2. Modify [stdbool.h.syn] as indicated:

    17.14.5 Header <stdbool.h> synopsis [stdbool.h.syn]

    #define __bool_true_false_are_defined 1
    

    -1- The contents of the C++ header <stdbool.h> are the same as the C standard library header <stdbool.h>, with the following changes: The header <stdbool.h> does not define macros named bool, true, or false. The macro __bool_true_false_are_defined ([depr.c.macros]) is deprecated.

    See also: ISO C 7.18

  3. Add a new subclause to Annex [depr] between [depr.res.on.required] and [depr.relops], with this content:

    D?? Deprecated C macros [depr.c.macros]

    -1- The header <stdalign.h> has the following macro:

    #define __alignas_is_defined 1
    

    -2- The header <stdbool.h> has the following macro:

    #define __bool_true_false_are_defined 1
    
Date: 2022-11-11.18:12:06

[ Kona 2022-11-10; Waiting for LEWG electronic polling ]

Date: 2022-11-11.00:35:44

[ Kona 2022-11-10; Jonathan provides wording ]

Date: 2022-11-10.00:00:00

This is the resolution for NB comments:

  • GB-081 17.14.4 [stdalign.h.syn] Deprecate contents of <stdalign.h>.
  • GB-082 17.14.5 [stdbool.h.syn] Deprecate contents of <stdbool.h>.

GB-081:

C2x defines alignas as a keyword, so <stdalign.h> is empty in C2x. C++23 should deprecate the __alignas_is_defined macro now, rather than wait until a future C++ standard is based on C2x. That gives users longer to prepare for the removal of the macro.

Recommended change: Deprecate __alignas_is_defined and move it to Annex D. Maybe keep a note in [stdalign.h.syn] that the macro is present but deprecated.

GB-082:

C2x supports bool as a built-in type, and true and false as keywords. Consequently, C2x marks the __bool_true_false_are_defined as obsolescent. C++23 should deprecate that attribute now, rather than wait until a future C++ standard is based on C2x. That gives users longer to prepare for the removal of the macro.

Recommended change: Deprecate __bool_true_false_are_defined and move it to Annex D. Maybe keep a note in [stdbool.h.syn] that the macro is present but deprecated.

History
Date User Action Args
2022-11-11 18:12:06adminsetmessages: + msg13020
2022-11-11 18:12:06adminsetstatus: new -> lewg
2022-11-10 23:08:36adminsetmessages: + msg12999
2022-11-10 23:08:36adminsetmessages: + msg12998
2022-11-10 00:00:00admincreate