[freetds] lib-ct and Visual C++, libcmt under Windows
James K. Lowden
jklowden at freetds.org
Tue Sep 4 20:24:37 EDT 2007
Sergey Semenyuk wrote:
> libtds uses string that looks like "%b %e %Y ..." for default locale
> format. VC strftime DOES NOT happen to support %e in the format, and
> using it makes the whole thing generate GPE (0d). Isn't it nice? I've
> changed %e to %d, and it did the job.
It's too bad standards compliance is so difficult. My NetBSD manual
indicates %e, while part of SuS3, is not defined by C99 (ISO/IEC
9899:1999). But "If a conversion specification does not correspond to any
of the above, the behaviour is undefined." Still, IMHO crashing the system
is a suboptimal choice.
Thanks for the heads-up. A quick scan of the code shows about 9 such
strings. They should become global static constants, wrapped in an #ifdef
to use %d when WIN32 is defined, else %e. That's an afternoon's work for
someone who cares to do it right.
Blank padding is Sybase's behavior IIRC, so %e is preferable to %d.
More information about the FreeTDS