В Windows uint16_t
это просто typedef
из unsigned short
(от VS2017 stdint.h
):
typedef unsigned short uint16_t;
Но на QNX6 с GCC uint16_t
от stdint.h
относится к _Uint16t
:
typedef _Uint16t uint16_t;
который объявлен в include\sys\compiler_gnu.h
следующим образом:
typedef unsigned int _GCC_ATTR_ALIGN_u16t __attribute__((__mode__(__HI__)));
typedef _GCC_ATTR_ALIGN_u16t _Uint16t __attribute__((__aligned__(2)));
В чем причина для выравнивания uint16_t
в этом случае?
Вопрос возник из кода ниже:
using T = uint16_t;
std::map<T, unsigned char> m;
Что дает мне предупреждение:
warning: ignoring attributes on template argument 'T {aka short unsigned int}'
[-Wignored-attributes]
Должен ли я вернуться к using T = unsigned short;
, чтобы предотвратить такое предупреждение?