incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <>
Subject RE: Windows infrastructure for generating VisualStudio projects and solution(s)
Date Tue, 22 Aug 2006 13:10:36 GMT
> -----Original Message-----
> From: Martin Sebor [] 
> Sent: Tuesday, August 22, 2006 4:08 AM
> To:
> Subject: Re: Windows infrastructure for generating 
> VisualStudio projects and solution(s)
> >   - added optional parameter /WCHAR_T:{yes|no}:
> >       when yes, the native wchar_t enabled;
> >       when no, the native wchar_t disabled;
> >       when no option specified, the native wchar_t is 
> default to the 
> > compiler.
> I think a more general solution might be called for, one that 
> would let users specify additional command line options to 
> the compiler or linker. The GNU makefile infrastructure uses 
> CPPOPTS, CXXOPTS, and LDOPTS for this purpose and simply 
> appends the values of these variables to the end of CPPFLAGS, 

  It's a good idea!

> >   - "Force Conformance in for Loop Scope" is turned on (I see no 
> > problem with it)
> You shouldn't see any problems since that's how all 
> conforming compilers are required to behave and how most in 
> fact do. But not every compiler conforms and MSVC is an 
> example of one that doesn't, at least not out of the box. In 
> order to make sure we can handle those as well we need to 
> test the library both ways (with and without the feature). 
> I.e., we cannot rely on the feature in our library headers 
> (we can fake it in our sources by the well known trick: 
> '#define for if (0); else for').

  If the compiler do not conform in "for loop scope" then
generated config.h file will contain #define _RWSTD_NO_FOR_LOCAL_SCOPE.
I searched _RWSTD_NO_FOR_LOCAL_SCOPE macro in source files
and found it in examples\include\examples.h and tests\include\testdefs.h
files only:
#  define for if (0) ; else for

  The conslusions:
1. the stdlib and utils itself are independent from compiler "for loop
conformance (because of they not uses _RWSTD_NO_FOR_LOCAL_SCOPE
2. the examples and tests itself are independed from compiler "for loop
conformance too (because of they get the conformance by defining "for"
"if (0); else for" in case when compiler do not conform).

  What kind of problem could be when user link his project (compiled by
without /Zc:forScope option enabled) with the stdcxx library (compiled
with this
option enabled)? Could you, please, show the example?

  BTW in MSVC8 the "for loop scope" conformance and native wchar_t
are enabled by default.


View raw message