Skip to Content.
Sympa Menu

freetds - Re: [freetds] lib-ct and Visual C++, libcmt under Windows

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] lib-ct and Visual C++, libcmt under Windows
  • Date: Tue, 4 Sep 2007 20:24:37 -0400

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.

http://opengroup.org/onlinepubs/007908799/xsh/strftime.html

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.

--jkl





  • Re: [freetds] lib-ct and Visual C++, libcmt under Windows, James K. Lowden, 09/04/2007

Archive powered by MHonArc 2.6.24.

Top of Page