Help needed on std::map<> 
Author Message
 Help needed on std::map<>

The code:

    #include <map>
    typedef std::map< ULONG, ULONG > IOMAP;
    typedef IOMAP::iterator ITERATOR;

Problem:
While compiling in debug mode level 3 (VC++) I get a bunch of following
errors:
    c:\appwin32\vs60\vc98\include\xtree(200) : warning C4786:
..........:identifier was truncated to '255' characters in the browser
information.

Question:
Any thought on how to make this compile without warnings  in debug
environment?  I don't want to use pragmas to disable the warning, I'd rather
solve the problem instead of cheating it.

TekCat



Sun, 17 Nov 2002 03:00:00 GMT  
 Help needed on std::map<>
Greets,

    Unfortunately there is really no way I have found to solve the problem.
The expansion of the decorated names exceeds the 255 character limit imposed
on symbols for the browser database.  This really does not have anything to
do with the compiler, however, your best way to be rid of this is to use the
#pragma.  If you the debug information generated, you will need to surpress
the warning.

Regards,

Joe


Quote:
> The code:

>     #include <map>
>     typedef std::map< ULONG, ULONG > IOMAP;
>     typedef IOMAP::iterator ITERATOR;

> Problem:
> While compiling in debug mode level 3 (VC++) I get a bunch of following
> errors:
>     c:\appwin32\vs60\vc98\include\xtree(200) : warning C4786:
> ..........:identifier was truncated to '255' characters in the browser
> information.

> Question:
> Any thought on how to make this compile without warnings  in debug
> environment?  I don't want to use pragmas to disable the warning, I'd
rather
> solve the problem instead of cheating it.

> TekCat



Sun, 17 Nov 2002 03:00:00 GMT  
 Help needed on std::map<>
The MS KB lists one way to do it, but it only applies when the types being
used are your own (i.e. not DWORD).

For example, suppose you had a this (contrived) setup

class CMyReallyReallyReallyLongNamedKey {...};
class CMyReallyReallyReallyLongNamedVal {...};

typedef std map <CMyReallyReallyReallyLongNamedKey,
                         CMyReallyReallyReallyLongNamedVal> CMyMap;

Now if you were to put the following two lines immediately in front of the
class definitions, you might get around it

#define CMyReallyReallyReallyLongNamedKey MK
#define CMyReallyReallyReallyLongNamedKey MV

Thus you would use the full class names in your code so it would still read
properly, but the preprocessor would silently replace the full names with
the very short names 'MK' and 'MC'.

I would absolutely *not* recommend trying this with built-in types (e.g.
int) or MS-defined types (e.g. DWORD) or you'll get into trouble.  But when
the problem is your own classes it can help in a pinch.

It's a hack either way.  Here's hoping the next version of VC expands the
max symbol name size

Joe


Quote:
> Greets,

>     Unfortunately there is really no way I have found to solve the
problem.
> The expansion of the decorated names exceeds the 255 character limit
imposed
> on symbols for the browser database.  This really does not have anything
to
> do with the compiler, however, your best way to be rid of this is to use
the
> #pragma.  If you the debug information generated, you will need to
surpress
> the warning.

> Regards,

> Joe



> > The code:

> >     #include <map>
> >     typedef std::map< ULONG, ULONG > IOMAP;
> >     typedef IOMAP::iterator ITERATOR;

> > Problem:
> > While compiling in debug mode level 3 (VC++) I get a bunch of following
> > errors:
> >     c:\appwin32\vs60\vc98\include\xtree(200) : warning C4786:
> > ..........:identifier was truncated to '255' characters in the browser
> > information.

> > Question:
> > Any thought on how to make this compile without warnings  in debug
> > environment?  I don't want to use pragmas to disable the warning, I'd
> rather
> > solve the problem instead of cheating it.

> > TekCat



Sun, 17 Nov 2002 03:00:00 GMT  
 Help needed on std::map<>
Greets,

    I certainly agree that there are such means for trickery.  While it may
make the warnings subside, it may make it less intuitive to debug when
referring to those aliased symbols.  (Although I am inclined to believe the
expanded symbol names may do a good job at that as it is!)  Since I find the
warning itself to not have been caused by misuse of the C++ language itself,
I do not feel guilty supressing such.  While I personally do not see it as a
high priority, I too hope they increase the maximum size of symbol names
used by the browser.  :)

Regards,

Joe


Quote:
> The MS KB lists one way to do it, but it only applies when the types being
> used are your own (i.e. not DWORD).

> For example, suppose you had a this (contrived) setup

> class CMyReallyReallyReallyLongNamedKey {...};
> class CMyReallyReallyReallyLongNamedVal {...};

> typedef std map <CMyReallyReallyReallyLongNamedKey,
>                          CMyReallyReallyReallyLongNamedVal> CMyMap;

> Now if you were to put the following two lines immediately in front of the
> class definitions, you might get around it

> #define CMyReallyReallyReallyLongNamedKey MK
> #define CMyReallyReallyReallyLongNamedKey MV

> Thus you would use the full class names in your code so it would still
read
> properly, but the preprocessor would silently replace the full names with
> the very short names 'MK' and 'MC'.

> I would absolutely *not* recommend trying this with built-in types (e.g.
> int) or MS-defined types (e.g. DWORD) or you'll get into trouble.  But
when
> the problem is your own classes it can help in a pinch.

> It's a hack either way.  Here's hoping the next version of VC expands the
> max symbol name size

> Joe



> > Greets,

> >     Unfortunately there is really no way I have found to solve the
> problem.
> > The expansion of the decorated names exceeds the 255 character limit
> imposed
> > on symbols for the browser database.  This really does not have anything
> to
> > do with the compiler, however, your best way to be rid of this is to use
> the
> > #pragma.  If you the debug information generated, you will need to
> surpress
> > the warning.

> > Regards,

> > Joe



> > > The code:

> > >     #include <map>
> > >     typedef std::map< ULONG, ULONG > IOMAP;
> > >     typedef IOMAP::iterator ITERATOR;

> > > Problem:
> > > While compiling in debug mode level 3 (VC++) I get a bunch of
following
> > > errors:
> > >     c:\appwin32\vs60\vc98\include\xtree(200) : warning C4786:
> > > ..........:identifier was truncated to '255' characters in the browser
> > > information.

> > > Question:
> > > Any thought on how to make this compile without warnings  in debug
> > > environment?  I don't want to use pragmas to disable the warning, I'd
> > rather
> > > solve the problem instead of cheating it.

> > > TekCat



Mon, 18 Nov 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Help needed on std::map<>

2. <<<<<<<Parsing help, please>>>>>>>>

3. Need Help with std::set<CComBSTR>

4. File Format conversion, ascii freeform -->.csv <-->.wk1<-->dbf<-->?HELP

5. URGENT: STL std::map<ULONG, CEvent>

6. std::map< a , b >::lower_bound(c)

7. Need Help on map <TCHAR*, long>

8. <<<>>>Need C code advice with functions and sorting.<<<>>>

9. >>I need help!<<(duh)

10. <><><>HELP<><><> PCMCIA Motorola Montana 33.6

11. Warnings for std::vector<std::string>

12. typedef std::vector<std::string> Vector_String

 

 
Powered by phpBB® Forum Software