[ECOS] Re: CGY_SWAP16() seems broken to me.

Grant Edwards grante@visi.com
Sat Sep 22 15:23:00 GMT 2007

On 2007-09-22, Grant Edwards <grante@visi.com> wrote:

> My fix above should be completely transparent. if the value is
> being assigned to a 16 bit lvalue, the compiler will generate
> exactly the same code as when using the existing "broken"
> macro. If the result from CYG_SWAP16() is being masked by the
> user, the fixed macro will generate exactly the same code as
> the existing macro.
> The only argument against my fix would be to claim that
> CYG_SWAP16 is expected to return 24 bits in wider contexts, and
> returning only 16 bits is going to break code or surprise a
> user.

I've examined all uses of SWAP16 and the LE16/BE16 macros in my
source tree (which is a few months out of date), and it doesn't
look like any existing code depends on the fact that SWAP16()
produces 24 bits instead of 16.

Grant Edwards                   grante             Yow!  An INK-LING? Sure --
                                  at               TAKE one!! Did you BUY any
                               visi.com            COMMUNIST UNIFORMS??

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list