【发布时间】:2023-03-09 12:15:01
【问题描述】:
根据"Why subtract null pointer in offsetof()?" 中的回复(以及我对K&R 的阅读),C 标准不需要(size_t)((char *)0) == 0。不过,我从未见过将空指针转换为整数类型的情况会评估为其他任何值。
如果有(size_t)((char *)0) != 0的编译器或场景,是什么?
【问题讨论】:
标签: c compiler-construction pointers casting standards-compliance