This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: portable signed right shift


<<OK, great.  So what is an efficient, portable way to get a signed
right shift?
>>

There isn't one, because there is not even a portable representation
for signed numbers. If you think you know the representation, then
you can always do the shift as an unsigned number. 

That's the reason the standard does not define it. Note that this is
implementation defined, so it may well be that the definition from
the implementation corresponds to what you want, but clearly there
is no way to write standard portable C that is target independent
in this case!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]