Looking at the comments in the code, it appears that the rationale when written was to provide support for REALLY ancient systems that didn’t have some of these functions. Since that time, we added a configure check for vsnprintf, so I’m adding Paul/Larry’s suggested code, protected by that configure.
Since I suspect the configure check will always pass on any system of interest today, I think this will solve the problem. We can then address the broader question (e.g., do we even need this stuff any more at all?) in a more leisurely way. > On Dec 12, 2014, at 5:42 PM, Larry Baker <ba...@usgs.gov> wrote: > > On 12 Dec 2014, at 5:22 PM, Paul Hargrove wrote: > >> HOWEVER, while the patch catches the "%u" case, there are plenty of >> potential ways to hit the same problem if, for instance, one uses "%zu" for >> size_t. Additionally, I've already noted that the code for "%ld", "%lx", >> "%lX", "%lf" are all currently incorrect. > > > Not sure if it is applicable, but C99 has an <inttypes.h> header which > #include's <stdint.h> and provides additional capabilities, such as > printf()/scanf() format macros for the types defined in <stdint.h>. > > Larry Baker > US Geological Survey > 650-329-5608 > ba...@usgs.gov <mailto:ba...@usgs.gov> >