From gwyn@arl.mil Mon Nov 1 16:31 PST 1999 Received: by cobra.uucp (8.9.3/8.9.3/2.33c) id QAA02597 for cobra!jb; Mon, 1 Nov 1999 16:31:47 -0800 (PST) for jb@peren.com; Mon, 1 Nov 1999 16:12:47 -0800 (PST) (peer crosschecked as: sjc3-1.relay.mail.uu.net [199.171.54.122]) id QQhnna10779 for ; Mon, 1 Nov 1999 23:40:29 GMT Received: by peren.com (8.9.3/8.9.3/2.33c) id QAA14507 for jb@peren.com; Mon, 1 Nov 1999 16:12:47 -0800 (PST) (peer crosschecked as: sjc3-1.relay.mail.uu.net [199.171.54.122]) id QQhnna10779 for ; Mon, 1 Nov 1999 23:40:29 GMT Received: from sjc3-1.relay.mail.uu.net by wodc7ug0.ffx.ops.us.uu.net with ESMTP (peer crosschecked as: sjc3-1.relay.mail.uu.net [199.171.54.122]) id QQhnna10779 for ; Mon, 1 Nov 1999 23:40:29 GMT Received: from soiree.arl.mil by sjc3sosrv11.alter.net with SMTP (peer crosschecked as: spu12.arl.mil [128.63.15.12]) id QQhnna16519 for ; Mon, 1 Nov 1999 23:40:28 GMT >Received: by peren.com (8.9.3/8.9.3/2.33c) id QAA14507 for jb@peren.com; Mon, 1 Nov 1999 16:12:47 -0800 (PST) >Received: from sjc3-1.relay.mail.uu.net by wodc7ug0.ffx.ops.us.uu.net with ESMTP (peer crosschecked as: sjc3-1.relay.mail.uu.net [199.171.54.122]) id QQhnna10779 for ; Mon, 1 Nov 1999 23:40:29 GMT Date: Mon, 1 Nov 1999 18:40:25 EST From: "Douglas A. Gwyn (IST)" To: jb@peren.com Subject: HTML source for WG14 N896 (DR 209) Message-ID: <9911011840.aa18061@soiree.arl.mil> Content-Type: text Content-Length: 2233 Status: R WG14 DR#209: Problem implementing INTn_C macros

WG14 N896 (J11 99-031)

Defect Report # 209

 

Title:  
Problem implementing INTN_C macros

Submission date:   19 Oct. 1999
Submitter:   Douglas A. Gwyn (J11)

Issue:

The requirements of subclause 7.18.4.1 may be impossible to satisfy (for N=8 or 16, typically) unless an implementation has special (non-standard) support for integer constants of types char and short:

The macro INTN_C(value) shall expand to a signed integer constant with the specified value and type int_leastN_t.

(Similarly for UINTN_C.)  The paragraph preceding this overly restrictive specification reflects the actual intent:

… a type with at least the specified width.

Possible Solutions:

  1. Change “integer constant” to “integer constant expression”.  While this still does not reflect the original intent, at least it permits accurate implementation without special support from the compiler.
  2. Specify that the type shall be the promoted type corresponding to int_leastN_t.
  3. Specify that the type shall be any appropriately signed integer type of sufficient width.

Proposed Technical Correction:

In subclause 7.18.4.1 paragraph 2, change the two occurrences of “and type” to “and [un]signed integer type at least as wide as”.