Help with long symbol names generated by templates.

P

Peter Smithson

Hi,

I'm very new to C++ so bear with me.

typedef list<string> jcllist; // list of strings
typedef map<string, jcllist> proglist; // associative array of lists
static proglist ProgList;

I do that within a normal function (it has to be called from C so
there's no classes or anything - also I'm new to this anyway so it's
easier for me).

Using aCC on hpux11 itanium, I get a warning about a 6Kb+ symbol name
being truncated to about 4Kb. Presumably these templates generate some
very long symbol names.

When I run the program, it gets a core dump somewhere in an allocator.

The same code works OK with visual studio 6.0 on Windows and with gcc on
hpux 11 32 bit pa-risc.

The warnings are making me think I've done something stupid. Is it
normal to do what I did? Should I be doing something different? I
realise I might have to explain more of the algorithim but maybe someone
will be able to see the problem straight away.

Thanks

Peter
 
I

Ivan Vecerina

Peter Smithson said:
I'm very new to C++ so bear with me.

typedef list<string> jcllist; // list of strings
typedef map<string, jcllist> proglist; // associative array of lists
static proglist ProgList;
This code is ok.
I do that within a normal function (it has to be called from C so
there's no classes or anything - also I'm new to this anyway so it's
easier for me).

Using aCC on hpux11 itanium, I get a warning about a 6Kb+ symbol name
being truncated to about 4Kb. Presumably these templates generate some
very long symbol names.
Yes, this is "normal" on some platforms. There are some ways to reduce
the size of the symbols if required (e.g. by making jcllist a class
When I run the program, it gets a core dump somewhere in an allocator.
I do not expect that the above warning is related to the core dump.
It is most likely a different issue,
The same code works OK with visual studio 6.0 on Windows and with gcc on
hpux 11 32 bit pa-risc.

The warnings are making me think I've done something stupid. Is it
normal to do what I did? Yes.
Should I be doing something different? No.
I realise I might have to explain more of the algorithim but
maybe someone will be able to see the problem straight away.
Not based on the above information, or not in this newsgroup.
You probably need to provide more details. And because this
might be a platform-specific issue (e.g. related to the use
of C++ in a C library), you may increase your chances of
getting a helpful anser by posting that next question
on a platform-specific forum rather than
in comp.lang.c++ ...


I hope this helps,
Ivan
 
P

Peter Smithson

I do not expect that the above warning is related to the core dump.
It is most likely a different issue,
Thanks - you're dead right. I did a bit more investigation by
#ifdef'ing out all the <list> and <map> code and I was left with a
function that just declares a string and adds a constant to it.

It works fine in a small test program (as you'd expect) so it must be
something with the environment or the rest of the project so I'll
continue experimenting.

Glad to know my C++ code was OK.

Thanks.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top