We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
建议代码中不要出现具体的数据类型如char、int、short等等,因为这些具体的类型在不同的编译环境中的长度是不同的,尤其是char,有的编译器默认是无符号的、有的默认是有符号的,这会给移植带来问题。
数据类型一律统一定义、见其名知其意,如可定义: #define u8 unsigned char #define s8 signed char ... ... 代码中只用s8、或者u8,这样在移植时,只需要根据不同编译环境重新定义u8、s8即可,否则还要关心数据长度、char是否有符号等问题。
The text was updated successfully, but these errors were encountered:
还是直接用uint8_t这种C99支持的方式比较好
Sorry, something went wrong.
No branches or pull requests
建议代码中不要出现具体的数据类型如char、int、short等等,因为这些具体的类型在不同的编译环境中的长度是不同的,尤其是char,有的编译器默认是无符号的、有的默认是有符号的,这会给移植带来问题。
数据类型一律统一定义、见其名知其意,如可定义:
#define u8 unsigned char
#define s8 signed char
... ...
代码中只用s8、或者u8,这样在移植时,只需要根据不同编译环境重新定义u8、s8即可,否则还要关心数据长度、char是否有符号等问题。
The text was updated successfully, but these errors were encountered: