Boost logo

Boost Users :

Subject: Re: [Boost-users] [General] Warnings and pragmas in MSVC
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2009-01-14 08:46:58


On Wed, Jan 14, 2009 at 1:34 PM, Peter Barker <newbarker_at_[hidden]> wrote:

> On Wed, Jan 14, 2009 at 10:50 AM, Robert Jones <robertgbjones_at_[hidden]>
> wrote:
> > On Wed, Jan 14, 2009 at 10:39 AM, Peter Barker <newbarker_at_[hidden]>
> wrote:
> >>
> >> On Wed, Jan 14, 2009 at 10:28 AM, Robert Jones <robertgbjones_at_[hidden]
> >
> >> wrote:
> >> > I've written some code using the Lambda & Lambda.bind libraries,
> >> > although I don't think that really matters, which produce a page ful
> >> > of C4503 warnings,
> >> >
> >> > 4503 'identifier' : decorated name length exceeded, name was truncated
> >> >
> >> > In my code I've tried using pragma disable around the lines which I
> >> > altered
> >> > to cause the warnings, but it makes no difference. Is it necessary to
> >> > apply
> >> > these pragmas within the Boost library code, or is there a better way?
> >> >
> >> > Thanks, Rob.
> >> >
> >> >
> >> > _______________________________________________
> >> > Boost-users mailing list
> >> > Boost-users_at_[hidden]
> >> > http://lists.boost.org/mailman/listinfo.cgi/boost-users
> >> >
> >>
> >> What MSVC version are you using?
> >>
> >
> > Microsoft Visual Studio 2005 Pro
> > Microsoft Visual C++ 2005
> >
> > Thanks, Rob.
>
> Rob,
>
> You could disable the warning for the entire project by going into
> Project|Properties, C/C++, Advanced and enter it in the "Disable
> Specific Warnings" box. I'm using MSVC7 (2003) and had to do that for
> C4675 (ADL lookup warning).
>
> Bear in mind I don't know the nature of the warning though. Anyone
> else seen his warning?
>
>
Yes, that was the conclusion I came to, and in fact I can use the properties
on a per file basis to do this. Strangley it also works if I put
#pragma warning( disale : 4503 )
at the top of the .cpp file causing problems, but does not work if I put

#pragma warning( push )
#pragma warning( disable : 4503 )
...my whole .cpp file
#pragma warning( pop )

and does not work if I put the same #pragmas around the #include of
all my boost headers. It's all a bit bizarre.

The warning itself is not a worry - it's just telling me that a name
generated
through multiple template instantiations is longer than 4096 characters.
According
to the MS docs this does invalidate the program or generated code, but
can be an issue for debugging and symbol tracking.

Thanks,

Rob.



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