Re: New attribute proposal: [[gnu::no_int_promotion]]

2021-11-10 Thread Joseph Myers
On Wed, 10 Nov 2021, Alejandro Colomar (man-pages) via Gcc wrote: > I'm proposing an attribute that would apply a new set of rules, specifically > designed for fixed width operations, but which also try to be sane defaults > for any other scenario. Let's call it [[gnu::no_int_promotion]]). C23 _

New attribute proposal: [[gnu::no_int_promotion]]

2021-11-10 Thread Alejandro Colomar (man-pages) via Gcc
Hi, Usual arithmetic promotions are (sometimes) quite unexpected. Especially, in random architectures where int may be wider than expected. Fixed-width math in C has been partially supported since C99. I say partially, because the following code may surprise some (few) programmers: uint16_