From: Lois Goldthwaite (loisg_at_[hidden])
Date: 1999-10-28 01:19:25
I haven't checked with VC++ 6.0, but in earlier versions of the compiler, you
could have problems if you tried to inspect the value of the shortened name in the
debugger. You may find that mangled names are longer in a debug build than in a
One possible workaround is to find a way to shorten the name. Depending on what
types contribute to the long mangled names, here are possible examples:
#define basic_string b_s
#define char_traits c_t
Typedefs do NOT help. You have to use the preprocessor to shorten the names of the
underlying types. If the same types are found in a library, this can cause linking
problems unless you rebuild the library with the same macros in force.
It's a trial-and-error process to come up with something that works. But unless
you encounter other problems, I would agree with Ed that it's OK to ignore the
Ed Brey wrote:
> Gaddy Barchana-Lorand wrote:
> > I have downloaded the smart_ptr.hpp header file, and when compiling my code
> > (with MSVC 6.0) I get the the C4503 warning (decorated name length exceeded,
> > name was truncated).
> I recently ran into this same problem, although with my own template,
> rather than a boost one.
> > 1. Is there a way to avoid the warning (as I'm using the smrt_ptr with STL -
> > the names get very long quite easily)?
> Get a better compiler. Of course, if you're like me and that option
> doesn't work, a viable plan B is to simply disable the warning with
> #pragma disable.
> > 2. Is it safe to ignore the warning (Don't think so...)?
> AFAK, it is. The warning is telling you that the compiler is
> truncating the mangled name at 255 characters, much like the way more
> primitive compilers used to truncate variable names at 32 characters.
> So, as long as your first 255 characters are unique, you're fine. I
> haven't examined the mangled names in detail, but I expect that this
> is the case, based on where I see early differences that I see in the
> "human readable" names that the compiler spits on an error.
> If the 255 character limit did cause a name clash, you should get a
> diagnostic from the linker or compiler complaining that the name is
> multiply defined, which makes me more comfortable with just turning
> off the warning. Disclaimer: I haven't tested this theory. In any
> case, I've been running with the warning turned off, and haven't had
> any problems so far.
> > If you answer - please reply to my email as well (as I didn't know how to
> > subscribe to this mailing list).
> >From the egroups site:
> To subscribe, send a message to boost-subscribe_at_[hidden] or go the
> this e-group's home page at http://www.egroups.com/list/boost
> Receive Red Hat Linux 6 Toolkit - a 3 book
> + 2-CDs for $9.99! A $109.97 value, yours
> with membership in Library of Computer and
> Information Sciences. Order at
> eGroups.com home: http://www.egroups.com/group/boost
> http://www.egroups.com - Simplifying group communications
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk