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

Simplify endian conversion functions in std.bitmanip. #8822

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Sep 24, 2023

  1. Simplify endian conversion functions in std.bitmanip.

    They're overly complex (e.g. testing for the native endianness of the
    machine when that's actually completely unnecessary), and they use
    unions in a manner that is undefined behavior in C/C++ (since they write
    to one field and then read from another). I don't see any mention of
    whether that behavior is defined in D in D's spec, but it's probably
    undefined in D given that it's undefined in C/C++. Either way, it's an
    overly complex solution.
    
    This solution gets rid of all of the endian version checks in
    std.bitmanip, and it allows the implementations of the endian conversion
    functions to be the same between CTFE and runtime.
    jmdavis committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    d6604d9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dcb6d97 View commit details
    Browse the repository at this point in the history