是否有任何现有的C实现具有(un)有符号整数表示中的填充位?
根据C99,签名int或unsigned int表示中可能有填充位.所以我不知道还有什么实现有这样的过时的东西吗?
解决方法
引用C99理由(
PDF)第6.2.6.2节§20:
所以这样的事情至少确实存在. 至于奇怪的建筑still around today,例如UNIVAC 1100/2200系列及其weird data formats. 虽然它不使用整数填充,但是看看他们的C编译器手册(PDF)仍然是有启发性的: Table 4–4. Size and Range of Unsigned Integer Types Type Size Range unsigned short int 18 bits 0 to (2^18)–1 unsigned short unsigned int 36 bits 0 to (2^36)–2 (see the following note) unsigned unsigned long int 36 bits 0 to (2^36)–2 (see the following note) unsigned long 第二卷(PDF)解释了如何使用CONFORMANCE / TWOSARITH编译器关键字来控制负零的解释:这将无符号整数类型的范围调整为预期(2 ^ 36)-1,但会对性能造成损害无符号算术. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |