[Cfp-interest 3292] Re: N3288 (Give consistent wording for SNAN initialization)

RAJAN BHAKTA rbhakta at us.ibm.com
Tue Oct 1 07:33:30 PDT 2024


Here it is.

Regards,

Rajan Bhakta


From: RAJAN BHAKTA <rbhakta at us.ibm.com>
Date: Tuesday, October 1, 2024 at 9:31 AM
To: Jim Thomas <jaswthomas at sbcglobal.net>
Cc: cfp-interest at oakapple.net <cfp-interest at oakapple.net>
Subject: Re: [EXTERNAL] Re: [Cfp-interest 3289] N3288 (Give consistent wording for SNAN initialization)
Looks good to me. Will add that to a new version.

Regards,

Rajan Bhakta


From: Jim Thomas <jaswthomas at sbcglobal.net>
Date: Monday, September 30, 2024 at 2:48 PM
To: RAJAN BHAKTA <rbhakta at us.ibm.com>
Cc: cfp-interest at oakapple.net <cfp-interest at oakapple.net>
Subject: [EXTERNAL] Re: [Cfp-interest 3289] N3288 (Give consistent wording for SNAN initialization)
On Sep 30, 2024, at 11: 21 AM, RAJAN BHAKTA <rbhakta@ us. ibm. com> wrote: Hello, Summary for this morning: N3286 Floating-point exceptions for macro replacements: Straw poll: Adopt N3286 in C2Y? 10+6/0/6. 16/0/6. Passes. ^AI: Ballman: Put



On Sep 30, 2024, at 11:21 AM, RAJAN BHAKTA <rbhakta at us.ibm.com> wrote:

Hello,

Summary for this morning:
N3286 Floating-point exceptions for macro replacements:
  Straw poll: Adopt N3286 in C2Y?
    10+6/0/6. 16/0/6. Passes.
  ^AI: Ballman: Put N3286 to the list of retroactive changes to previous standards.

N3287 Nonsensical Parenthetical:
  Straw poll: Put N3287 in C2Y?
    10+8/0/4. 18/0/4. Passes.

N3288 Give consistent wording for SNAN initialization
  Request to have N3288 say translation time instead of static storage duration.

With regards to the last item, here is a proposed update. Please let me know if you have any issues with it:


Proposal for C2Y
WG14 Nxxxx (revision 2 of N3288)
Title: Give consistent wording for SNAN initialization
Author, affiliation: C FP group
Date: 2024-09-30
Proposal category: Editorial
Reference: Base document: N3220

Changes from N3288 (1st version):
  - As per WG14 preference (to include constexpr), the "translation time" wording is selected instead.

Proposal:

SNAN used at translation time has different wording in two places: 5.2.4.2.2#22 mentions SNAN for translation time initializer, while H.3#6 mentions static or thread storage duration. There should be consistent wording in both places. In the following, "translation time" phrase is used to maintain consistency. In addition, binding of the "optional unary + or - operator" phrase may be confusing so it is moved to make it more clear that you can have +, -, or no preceding operator for a signaling NaN macro.

Proposed changes:

Change H.3#6 (in N3220) from:

If an optional unary + or - operator followed by a signaling NaN macro is used for initializing an object of the same type that has static or thread storage duration, the object is initialized with a signaling NaN value.

To:

If a signaling NaN macro, optionally preceded by the unary + or – operator, is used for initializing an object of the same type that is evaluated at translation time, the object is initialized with a signaling NaN value.

Two issues:

1. Objects aren’t evaluated. It would need to say something like

“… is used for initializing an object of the same type and the initializer is evaluated at translation time, the object is initialized with a signaling NaN value.”

or

“… Is used as an initializer that is evaluated at translation time to initialize an object of the same type, the object is initialized with a signaling NaN value.”


2. If the standard says “evaluated at translation time” is it clear that the reference is to semantics and not a possible optimization?

E.g. For

#pragma STDC FENV_ACCESS OFF
auto double x = SNAN;

The evaluation of SNAN is semantically runtime, but could be done at translation time as an optimization because of the pragma. However, the (semantically runtime) evaluation of SNAN results in a quiet NaN regardless of when the implementation evaluates it.

- Jim Thomas



Change 5.2.5.3.2#28 (in N3220) from:

If an optional unary + or - operator followed by a signaling NaN macro is used as an initializer that is evaluated at translation time, the object is initialized with a signaling NaN value.

To:

If a signaling NaN macro, optionally preceded by the unary + or – operator, is used for initializing an object of the same type that is evaluated at translation time, the object is initialized with a signaling NaN value.
_______________________________________________
Cfp-interest mailing list
Cfp-interest at oakapple.net<mailto:Cfp-interest at oakapple.net>
http://mailman.oakapple.net/mailman/listinfo/cfp-interest<http://mailman.oakapple.net/mailman/listinfo/cfp-interest>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20241001/e5e5788c/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C2y proposal NaN prefix 3.pdf
Type: application/pdf
Size: 19133 bytes
Desc: C2y proposal NaN prefix 3.pdf
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20241001/e5e5788c/attachment-0001.pdf>


More information about the Cfp-interest mailing list