ARM cortex-M3 uint_fast32_t vs uint32_t
发布时间:2020-12-14 01:52:58 所属栏目:Windows 来源:网络整理
导读:我正在为STM32Fx cortex-M3系列处理器开发一个程序.在stdint.h中定义了以下内容: typedef unsigned int uint_fast32_t;typedef uint32_t uint_least32_t;typedef unsigned long uint32_t; 据我了解. [u]int_fast[n]_t will give you the fastest data type
我正在为STM32Fx cortex-M3系列处理器开发一个程序.在stdint.h中定义了以下内容:
typedef unsigned int uint_fast32_t; typedef uint32_t uint_least32_t; typedef unsigned long uint32_t; 据我了解. [u]int_fast[n]_t will give you the fastest data type of at least n bits. [u]int_least[n]_t will give you the smallest data type of at least n bits. [u]int[n]_t will give you the data type of exactly n bits. 据我所知sizeof(unsigned int)< = sizeof(unsigned long)和UINT_MAX< = ULONG_MAX - 总是如此. 因此,我希望uint_fast32_t是一个大小等于或大于uint32_t大小的数据类型. 在cortex-M3 sizeof(unsigned int)== sizeof(unsigned long)== 4的情况下.因此上述定义在大小方面是“正确的”. 但是为什么它们的定义方式与基础数据类型的名称和逻辑大小不一致,即 typedef unsigned long uint_fast32_t; typedef unsigned int uint_least32_t; typedef uint_fast32_t uint32_t; 有人可以澄清基础类型的选择吗? 鉴于’long’和’int’的大小相同,为什么不对所有三个定义使用相同的数据类型? typedef unsigned int uint_fast32_t; typedef unsigned int uint_least32_t; typedef unsigned int uint32_t; 解决方法
情况是,只保证
sizeof(long) >= sizeof(int) 并且不能保证它实际上已经存在了.在很多系统上,int通常都很长. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 在Windows上重新定义Emacs中的密钥
- cosureDB模拟器上的azure-cosmosdb – api-ms-win-core-pat
- windows-server-2008 – 如何提高Hyper-V性能
- 使用Qt 4 vs Qt 5开发适用于Windows和OS X的应用程序?
- windows-7 – .NET Framework 4.0和Aero Glass问题的绘图
- windows-server-2008 – Windows Server 2008 – 无法解释的
- Microsoft Fakes和.Net 4.0
- windows – 使用InstallAnywhere更改文件夹权限
- win2012 挂载硬盘即增加新硬盘方法
- Windows上的nohup是什么?
推荐文章
站长推荐
- windows – ActivePerl. .pl文件不再执行,而是在
- windows-server-2008 – 为RDP创建锁定策略
- Windows CPU Scheduler – 内核时间非常长
- windows-server-2003 – 远程桌面问题
- windows – Powershell get-childitem输出格式
- Raspberry Pi 3 B+ 开箱基本配置(Windows环境下
- windows-server-2008 – Windows Server 2008上的
- Windows-8 – Visual Studio 2010 SP1与Windows
- 将Windows Mono运行时与应用程序捆绑在一起
- Loadrunner 录制问题
热点阅读