stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Pevtsov" <Ant...@moscow.vdiweb.com>
Subject RE: release configurations (8d, 8s, 12d, 12s) fail to compile on Windows, MSVC 7.1
Date Fri, 07 Apr 2006 14:37:34 GMT
Unfortunately, I didn't build release configurations during long periof
of time.

But I suspect this commit:
http://svn.apache.org/viewcvs?rev=374551&view=rev

It added the following code into cwchar:

...
#ifndef _RWSTD_NO_SWPRINTF
using ::swprintf;
#elif !defined (_RWSTD_NO_SWPRINTF_IN_LIBC)

}   // namespace std

extern "C" int swprintf (wchar_t*, size_t, const wchar_t*, ...);

namespace std {

using ::swprintf;

#  undef _RWSTD_NO_SWPRINTF
#endif   // _RWSTD_NO_SWPRINTF[_IN_LIBC]
...

And this with the following inculde-for-release-only code from _traits.h
(line 85)

...
#else   // if !defined (_RWSTDDEBUG) && !defined (_RWSTD_EDG_ECCP)
#  include _RWSTD_CSTRING   // for memcmp(), ...
#  include _RWSTD_CWCHAR    // wmemcmp(), ...
...

caused the compilation error. Also, the config.h contains the
_RWSTD_NO_SWPRINTF definition and not contains
_RWSTD_NO_SWPRINTF_IN_LIBC.

It seems that there is a conflict between declarations of the swprintf
from stdio.h and this one. 

The stdio.h contains

...
/* This non-standard definition exists for historical reasons to avoid
breaking old code */
_CRTIMP int __cdecl swprintf(wchar_t *, const wchar_t *, ...);
#ifdef  __cplusplus
/* For C++ we have an overloaded version with the standard definition */
extern "C++" _CRTIMP int __cdecl swprintf(wchar_t *, size_t, const
wchar_t *, ...);
#endif
...

It is possible to avoid the error (but not warning for dll's) using
extern "C++" instead of extern "C" to allow overloading, but I am not
sure that this way is correct.
The same is true for vswprintf and wctomb functions.


Thanks,
Anton Pevtsov 



-----Original Message-----
From: Martin Sebor [mailto:sebor@roguewave.com] 
Sent: Thursday, April 06, 2006 18:42
To: stdcxx-dev@incubator.apache.org
Subject: Re: release configurations (8d, 8s, 12d, 12s) fail to compile
on Windows, MSVC 7.1


Anton Pevtsov wrote:
> Building the library using any release configuration ens with the 
> following compile errors:

Hmm. Do you happen to know what commit caused this? Can you revert it in
your local tree to get past the errors until I figure out how to fix
whatever it is that's broken?

Martin

> 
> D:\Projects\RogueWave\work\apache\src\..\include\ansi\cwchar(311) : 
> error C2732:  linkage specification contradicts earlier specification 
> for 'swprintf'
>  
> D:\Projects\RogueWave\work\apache\src\..\include\ansi\cwchar(311) : 
> see declaration of 'swprintf'
> D:\Projects\RogueWave\work\apache\src\..\include\ansi\cwchar(371) : 
> error C2732:  linkage specification contradicts earlier specification 
> for 'vswprintf'
>  
> D:\Projects\RogueWave\work\apache\src\..\include\ansi\cwchar(371) : 
> see declaration of 'vswprintf'
> 
> At the same time debug configurations (11d, 11s, 15d, 15s) build 
> without errors.
> 
> 
> Thanks,
> Anton Pevtsov


Mime
View raw message