id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 13614,padding related issue on VS2017 with boost::endian,imak@…,Beman Dawes,"On Visual Studio 2017 upd3, there seems to be some unexpected padding-related behaviour, shown below. The issue might not necessarily be a library 'bug', but I think it's worth looking at. {{{ #!div style=""font-size: 80%"" Code highlighting: {{{#!c++ #include #include using namespace boost::endian; #pragma pack(push, 1) struct Empty {}; struct T1 { big_uint16_t d; uint8_t d2; }; struct T2 { uint16_t d; uint8_t d2; }; struct D0: T1 {} x0; // sizeof(x0) evaluates to 3 struct D1: T1, Empty {} x1; // sizeof(x1) evaluates to 4 <- i think this should also be 3 struct D2: T2, Empty {} x2; // sizeof(x2) evaluates to 3 // (uint8_t*)&x1.d2 - (uint8_t*)&x1.d evaluates to 2 (i.e. big_uint16_t is itself not padded) // // - tested with a struct containing a char[2], this did not happen // - tested on various versions of g++ and clang, but this did not happen either. #pragma pack(pop) using namespace std; int main() { printf(""%zu %zu %zu"", sizeof(x0), sizeof(x1), sizeof(x2)); return 0; } }}} }}} ",Bugs,new,To Be Determined,endian,Boost 1.67.0,Problem,,,