??????????????????????????????д?????????8λ?1?????????? uint32_t mask = ~((uint8_t)0); ???????????????????? 0xffffffff ??????????????????????????????д???????????£?
#include <stdint.h>
#include <iostream>
using namespace std;
int main()
{
uint8_t z = 0;
uint32_t x = ~(uint8_t)0;
uint32_t y = (uint8_t)~0;
cout << typeid(~(uint8_t)0).name() << endl;
cout << typeid((uint8_t)~0).name() << endl;
cout << x << endl;
cout << y << endl;
}
????????????(macOS?? Clang)???
????i
????h
????4294967295
????255
??????????????????д?????????????????????????????????????? typeid ????????????????????????????????????????? h ??????? uint8_t ????????????? int ???????????????????漲??????????????????????????? C99 ?????????????? 6.5 ?????漲???£?

????????? 6.5.3.3 ????????????

???????????????λ???????????????? uint8_t ?????????????????????????????????????????? -1 ????????????????????????????????? bit ????1????????????????е?λ???????1???
?????????????????????????????????????spec?ɡ?