[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: result type of INT16_C, UINT16_C
From: |
Ben Pfaff |
Subject: |
Re: result type of INT16_C, UINT16_C |
Date: |
Sat, 17 Jun 2006 11:21:41 -0700 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> However, 7.18.4 wants macros that expand to integer constants that
> are of type int_leastN_t or uint_leastN_t. But integer constants
> don't contain casts (section 6.4.4.1) - therefore it is impossible
> to write down integer constants of type, say, int_least16_t or
> uint_least16_t. How can INT16_C, UINT16_C be defined then?
I think you are overlooking the changes in Technical Corrigendum
1, which includes the following:
33. Page 259, 7.18.4
Add a new paragraph 3:
[#3] Each invocation of one of these macros
shall expand to an integer constant expression
suitable for use in #if preprocessing
directives. The type of the expression shall
have the same type as would an expression of the
corresponding type converted according to the
integer promotions. The value of the expression
shall be that of the argument.
34. Page 259, 7.18.4.1
Remove the first paragraph and footnote 221.
35. Page 259, 7.18.4.1
Change to existing paragraph 2, also renumbering it as 1:
[#1] The macro INTN_C(value) shall expand to an
integer constant expression corresponding to the
type int_leastN_t. The macro UINTN_C(value)
shall expand to an integer constant expression
corresponding to the type uint_leastN_t. For
example, if uint_least64_t is a name for the
type unsigned long long int, then
UINT64_C(0x123) might expand to the integer
constant 0x123ULL.
36. Page 260, 7.18.4.2
In paragraph 1, change both occurrences of "integer
constant" to "integer constant expression".
--
"If a person keeps faithfully busy each hour of the working day, he
can count on waking up some morning to find himself one of the
competent ones of his generation."
--William James