Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big Endian #19

Open
lehins opened this issue Sep 8, 2021 · 2 comments
Open

Big Endian #19

lehins opened this issue Sep 8, 2021 · 2 comments

Comments

@lehins
Copy link

lehins commented Sep 8, 2021

I'd like to point out that there is a bug in ghc <8 .10 that makes this code to not work correctly on Big Endian machines: https://gitlab.haskell.org/ghc/ghc/-/issues/20338

Code that uses buggy targetByteOrder function is here https://github.com/byteverse/bytesmith/blob/master/src/Data/Bytes/Parser/BigEndian.hs

@andrewthad I am sure you knew about this, since you opened https://gitlab.haskell.org/ghc/ghc/-/issues/18445 but I wanted to bring it up anyways, since I found it in github search.

@andrewthad
Copy link
Member

Is it only GHCs prior to 8.10 or including the 8.10.x series? Fortunately, I only develop for little-endian machines, so this does not affect me. Is there a recommended fix?

@lehins
Copy link
Author

lehins commented Sep 8, 2021

Fortunately, I only develop for little-endian machines

As everyone else in the universe 😄

It seems that ghc-8.10 had the fix implemented. So the only recommended way I see right now for dealing with this in libraries is to either have base >= 4.14 in cabal file or use CPP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants