On 28/11/14 15:57, Paul Eggert wrote: > Pádraig Brady wrote: > >> 1. Include the snprintf-posix gnulib module to fix this od issue, >> (but that would also use the replacement code in many more cases). >> >> 2. Adjust gnulib's ftoastr() to use the lower level vasnprintf-posix. >> That would work, though vasnprintf is not provided by glibc at all, >> so perhaps a lower level glibc equivalent function is preferred. >> >> 3. Since glibc no longer crashes, and no-one has complained about >> these edge cases of invalid numbers, just avoid this replacement altogether >> but push for the improvement to output "nan" in these cases in glibc. > > Thanks, I like this option [3] the best.
BTW Looking a bit more into option 1, I see that snprintf isn't used that much at all, though it is used in numfmt with %Lf and so we'd need for other portability reasons to avoid that or use snprintf-posix for that too. I'll look into avoiding that in numfmt. Pádraig.