Re: __typeof__ (const int)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2017-02-16 14:56 +0100, Aurelien Buhrig wrote:

> The pb is that both -32768 (0x8000) and 32767 should fit into an int
> (an int16_t actually), and the newlib <stdlib.h> defines INT16_MIN as
> -32768 .

According to the Standard, '32768' is a decimal literal, but '-32768'
is
not. It's an expression using unary '-' to the literal '32768'. Here
'32768' has type int32_t. So the expression also has type int32_t
despite the result can fit into an int16_t.
-- 
Xi Ruoyao <ryxi@xxxxxxxxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux