Boost logo

Boost Users :

From: Stefan Felkel (stefan.felkel_at_[hidden])
Date: 2007-04-25 07:46:20


> -----Ursprüngliche Nachricht-----
> Von: boost-users-bounces_at_[hidden]
> [mailto:boost-users-bounces_at_[hidden]]Im Auftrag von
> John Maddock
> Gesendet: Mittwoch, 25. April 2007 11:38
> An: boost-users_at_[hidden]
> Betreff: [SPAM] - Re: [Boost-users] [bind,regex] strange MSVC 7.1
> compiler effect: Members ofunnamednamespace are put in
> boost::re_detail
> when stdafx.hincludesbind.hpp and regex.hpp - E-Mail-Adresse wurde in
> Betreff-Zeile gefunden.
>
>
> Stefan Felkel wrote:
> > Hi there,
> >
> > I have a strange compiler effect with Microsoft Visual Studio.NET
> > 2003 and boost 1.33.1 in a project that uses bind and regex. All
> > Symbols defined in an unnamed namespace are part of the namespace
> > boost::re_detail::'anonymous-namespace'. The effect occurres when I
> > use precompiled headers and bind.hpp is included before regex.hpp.
> >
> > This is my stdafx.h which is used to generate the
> precompiled header:
> >
> > #pragma once
> >
> > #include <boost/bind.hpp>
> > #include <boost/regex.hpp>
> >
> > This is the main source file:
> >
> > #include "stdafx.h"
> > #include "boost/current_function.hpp"
> >
> > namespace {
> > void foo( void )
> > {
> > printf( "%s\n", BOOST_CURRENT_FUNCTION );
> > }
> > }
> >
> > int main( int argc, char * argv[] )
> > {
> > foo();
> > return 1;
> > }
> >
> > The program generates this output:
> >
> > void __cdecl boost::re_detail::`anonymous-namespace'::foo(void)
> >
> > instead of the expected output:
> >
> > void __cdecl `anonymous-namespace'::foo(void)
> >
> > When I change the include order in stdafx.h so that regex.hpp is
> > included before bind.hpp the output is as expected.
> > Has someone else came across such a problem? Is it a compiler bug?
>
> Weird indeed, I don't believe it's our problem as such:
> except that both
> regex and bind use unnamed namespaces. Looks like the poor
> compiler is
> getting confused :-(
>
> John.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

I think you're right - Microsoft Visual Studio.NET 2005 doesn't have this problem.

Stefan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net