On 06/19/2012 05:51 AM, John Spencer wrote: > #ifdef SYS_USES_LD80 > x = get_valid_ld80_or_zero(x); > #endif > > OSLT. why should i care ? go figure it out yourself.
As I understand it, it was your assertion that code like GNU od's could be written portably, using standard C. I was merely trying to check that assertion. As the above snippet does not appear to be portable standard C, we have not been able to verify the assertion in question. > you found one guy that wants to write floats into a file Lots of people write floats into a file. I've done it myself. That "one guy" was just one example. If people didn't need to read floats from files, 'od' wouldn't have options to do exactly that. >> I was talking about printf. > not it that paragraph. My paragraph was talking about GNU od, which uses snprintf to do the conversion. Presumably snprintf uses the same float-conversion machinery that printf does, so if snprintf has undefined behavior on floats, then GNU od will have undefined behavior as well, as will any other program that reads floats from files and prints them with printf or similar functions. > seriously, with your attitude On the contrary, we've all been remarkably polite, considering the circumstances. Are you accustomed to winning arguments via vituperation? Perhaps that strategy works well in musl circles, but it's counterproductive here.