Re: signed/unsigned integer conversion for right shift seems

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

 



"Also sprach Jonathan Wakely:"
> 
> On 6 February 2018 at 20:08, Tadeus Prastowo wrote:
> > Jonathan is not attacking you.
> 
> Well I am now, because he's insisting on continuing his off-topic
> wanderings through the C standard.

The question is if gcc is following the C standard.

You are counselled not to do the attacking thing, unless you would like
to be e-sat on and e-fingered by the e-police, or just generally
villified and derided as that e-wit throughout the Internet and the
e-iverse in general.

To summarize what we know:

6.1.3.8 of many C standards contains a list of for what operators
conversions should be applied "automatically", which means "without a
cast", which means "implicitly".  That list is prescriptive except
inasmuch as it is countermanded and/or overridden by the one-by-one
details of the operators in 6.5.  There is nothing else that applies, as
the authority at the start of section 6.1 says.

That is all.

In the case that I used to exemplify the situation, there are no
promotions (ints are already the args) and there are no conversions
because >> is not listed for conversions in 6.1.3.8 AND its own
paragraph in 6.5 does not say "conversions" (it says "promotions"
instead) AND 6.1 says that is all.

Done.

Exercise - try it with long long int in place of int.

Thank you for your contribution.

Regards

PTB




[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