Re:A critique of "How to C in 2016"
by lmm on Friday January 15, 2016 @10:28AM
(#10909809)
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).
[ Parent
| on HN ]
Re:A critique of "How to C in 2016"
by rc4algorithm on Friday January 15, 2016 @10:52AM
(#10909990)
> 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.
Re:A critique of "How to C in 2016"
by rc4algorithm on Friday January 15, 2016 @12:10PM
(#10910579)
Yeah, let's revert to 1988! Great solution! Muchly of advance!