This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
wrong decltype( INTN_C(value) )?
- From: Yaron Cohen-Tal <yaronct at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Sun, 27 Mar 2016 23:54:49 +0300
- Subject: wrong decltype( INTN_C(value) )?
- Authentication-results: sourceware.org; auth=none
Hi,
I was wondering: according to the C99 standard (I couldn't get hold of
the C11 standard) it seems like e.g. "INT8_C" should have the type
"int_least8_t". From section 7.18.4.1:
"The macro INTN_C(value) shall expand to a signed integer constant
with the specified value and type int_leastN_t"
However, on my system (Debian 8 x64) "INT8_C(1)" expands to "1" which
has type "int" (which is 32 bit) whereas "int_least8_t" has type
"signed char" (which is 8 bit). So is glibc not conformant to the
standard here, or there's anything I misunderstand? I'd expact it to
expand to "((signed char)1)".