[freetds] building 0.83.dev.20101013 with VC9: _vsnprintf error

Roman Neuhauser neuhauser at sigpipe.cz
Tue Oct 19 07:07:37 EDT 2010


# neuhauser at sigpipe.cz / 2010-10-14 18:25:54 +0200:
> # jklowden at schemamania.org / 2010-10-14 09:52:26 -0400:
> > On Thu, Oct 14, 2010 at 11:24:59AM +0200, Roman Neuhauser wrote:
> > > here's what i got building yesterday's snapshot with VC9.
> > > 
> > > c:\MinGW\msys\1.0\home\roman\wc\freetds-0.83.dev.20101013>nmake -nologo -f Nmakefile FROM_TARBALL= PLATFORM=win32 CONFIGURATION=debug
> > >         cl  -nologo     -W3 -Wp64 -EHsc -TC -Gm  -errorReport:prompt -D "_MBCS" -D "_LIB" -D "WIN32"  -D "_CRT_SECURE_NO_WARNINGS" -D _CRT_NONSTDC_NO_DEPRECATE -D "HAVE_CONFIG_H"  -D "_FREETDS_LIBRARY_SOURCE" -I "include" -I "win32" -I "include\x64" -c -MTd -Od -D "_DEBUG"  -ZI -RTC1   -Fo"src\replacements\win32\debug\\"  -Fd"src\replacements\win32\debug\vc80.pdb"  src\replacements\asprintf.c src\replacements\basename.c src\replacements\fakepoll.c src\replacements\gettimeofday.c src\replacements\getopt.c src\replacements\iconv.c src\replacements\readpassphrase.c src\replacements\strlcat.c src\replacements\strlcpy.c src\replacements\strtok_r.c src\replacements\vasprintf.c
> > ...
> > > getopt.c
> > > c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(358) : error C3163: '_vsnprintf': attributes inconsistent with previous declaration
> > >         c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(350) : see declaration of '_vsnprintf'
> 
> > I would try modifying win32/config.h to define HAVE_VSNPRINTF:
> > 
> > #define HAVE_VSNPRINTF 1
> 
> unfortunately this alone doesn't change the compiler output,
> and i'm busy with work and can't investigate it further.
> 
> freddy's advice got me through the whole build; i'll post
> details later.

minimal diff allowing me to get through the build is

--- a/include/tds_sysdep_private.h
+++ b/include/tds_sysdep_private.h
@@ -93,7 +93,6 @@
 #define strcasecmp stricmp
 #define strncasecmp strnicmp
 #define atoll _atoi64
-#define vsnprintf _vsnprintf
 #define snprintf _snprintf

 #ifndef WIN32

no changes needed in win32/config.h or src/replacements/getopt.c.

it looks (but i may be talking out of my ass) like pieces of
tds_sysdep_private.h duplicate bits from replacements.h, differently.

for example, which atoll is the right one? "#define atoll _atoi64"
or "tds_sysdep_int64_type atoll(const char *nptr);"?


-- 
roman



More information about the FreeTDS mailing list