Re: signed/unsigned integer conversion for right shift seems

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

 



On Tue, Feb 6, 2018 at 6:19 PM, Peter T. Breuer <ptb@xxxxxxxxxxxxxx> wrote:

[...]

> BTW, NOT saying something is applied in a specification should not mean
> that it is forbidden, as a general principle of specification languages.
> Is there somewhere in the C specification general blurb that says "no
> say, no do"?

[...]

> where it says that conversion MAY NOT or MUST
> NOT be applied to the arguments of >>.

Let's assume you could do one or more conversions as you wish.  But,
certainly you know you have to follow the spec, don't you?  Now the
specification of ISO-IEC 1989:1999 says in Section 6.5.7 Paragraph 3:
"The integer promotions are performed on each of the operands. The
type of the result is that of the promoted left operand."

Now, where do you want to perform your desired conversion?  Point A:
before "The integer promotions are performed on each of the operands"?
 Point B: before "The type of the result is that of the promoted left
operand"?  Point C: after "The type of the result is that of the
promoted left operand"?  Or any other point I have not mentioned?  Or
at two or more points that I have mentioned?

Try it for yourself if you can do one or more conversions at any of
the points I have mentioned without breaking the other part of the
spec.  So, if there is no loophole, a good spec shall not mention any
other extra thing, shall it?

> Regards and thanks
>
> PTB

--
Best regards,
Tadeus



[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