News for hackers. Stuff that matters.
Re:A Quiz About Integers in C by JulianMorrison on Monday June 04, 2012 @09:16AM (#4063823)
Then you probably want to mark it with an explicit function named something like "int32_to_uint32()" which you have defined (and debugged) in one place that performs the appropriate conversion with sanity checks.

Basically, IMO, C's implicit conversions are a flaw in the spec. A more sensible language would require every conversion (aside from those involving un-dimensioned constant data) to be spelled out explicitly. Since you can't make C sensible, the next best thing is to scrupulously isolate the stupid parts.

There are no comments on this comment yet.