Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Calloc is defined to return memory that's all-bits-zero, which in turn defines the value for many datatypes. The overwhelming majority of C implementations additionally define the values of all-bits-zero floats and pointers. IMO it's reasonable to write programs targeting only such implementations, provided such a dependency is clearly documented (just as e.g. it's reasonable to write C programs targeting only implementations on which floating-point arithmetic is IEEE 754, despite this not being required by the C standard).


> The overwhelming majority of C implementations additionally define the values of all-bits-zero floats and pointers.

So... Clang and GCC?

Regardless, you're ignoring the obvious difference: that isn't POSIX- or ISO-defined at all. If you choose to use it, you're using a weird dialect. Might as well just switch to Cyclone.


> that isn't POSIX- or ISO-defined at all. If you choose to use it, you're using a weird dialect.

People used C (even on multiple compilers) long before POSIX or ISO. You're putting the standardization cart before the compatibility horse.


Yeah, let's revert to 1988! Great solution! Muchly of advance!




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: