]> Sergey Matveev's repositories - stargrave-blog.git/commitdiff
Фиаско со сменой endianness
authorSergey Matveev <stargrave@stargrave.org>
Mon, 23 May 2022 08:02:19 +0000 (11:02 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 23 May 2022 08:02:19 +0000 (11:02 +0300)
https://justine.lol/endian.html
https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html
Нельзя просто так взять и поменять порядок байт в этом Си. И всё снова
из-за всяких undefined behaviour. Правило очень простое чтобы избежать
проблем: сначала надо применить маску, а потом уже делать сдвиг.


No differences found