Title
Deprecate <stdalign.h> and <stdbool.h> macros
Status
c++23
Section
[stdalign.h.syn][stdbool.h.syn]
Submitter
GB

Created on 2022-11-10.00:00:00 last changed 5 months ago

Messages

Date: 2023-02-13.11:31:32

Proposed resolution:

This wording is relative to N4928.

  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.

    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.

    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: 2023-02-13.00:00:00

[ 2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Immediate → WP. ]

Date: 2023-02-07.01:44:05

[ Issaquah 2023-02-06; LWG ]

Green text additions in Clause 17 was supposed to be adding notes. Drop them instead. Unanimous consent (14/0/0) to move to Immediate for C++23.

Date: 2022-11-15.00:00:00

[ 2022-11-08; Kona LEWG ]

Strong consensus to accept GB-81. Strong consensus to accept GB-82.

Previous resolution [SUPERSEDED]:

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
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2023-02-13 11:31:32adminsetmessages: + msg13388
2023-02-13 11:31:32adminsetstatus: immediate -> wp
2023-02-07 01:44:05adminsetmessages: + msg13277
2023-02-07 01:44:05adminsetmessages: + msg13276
2023-02-07 01:44:05adminsetstatus: lewg -> immediate
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