News for hackers. Stuff that matters.
Re:A review of endianness bugs in Qt, and how they were fixed by jcelerier on Saturday January 02, 2021 @06:09AM (#25611983)
> For example, if I wanted to read a little endian 32-bit integer value from a byte stream, I could write a function like this

But for the longest time people would basically dump the raw bytes of their structs from / to the network whenever possible, e.g.

    struct my_data {
        int foo, bar;
        float x,y,z;
        long dontdothat;
    } data;

    write_bytes_to_the_network((const unsigned char*) &data, sizeof(my_data));
Re:A review of endianness bugs in Qt, and how they were fixed by johannes1234321 on Saturday January 02, 2021 @11:59AM (#25614161)
This not only leads to the endianess issues, but also alignment/packing.

But yes, people often start that way and regret only when it is too late and the files are in the wild.