View Single Post

   
  #5 (permalink)  
Old 01-04-2008, 09:06 PM
Gilbert Chang
 
Posts: n/a
Default Re: string literal length limit with the AIX c++ compiler

Paul Pluzhnikov <ppluzhnikov-nsp@charter.net> wrote in message news:<m34qw698rf.fsf@salmon.parasoft.com>...
> "Gary R. Hook" <nospam@nospammers.net> writes:
>
> > Gilbert Chang wrote:
> >
> > > Got the following error when compiling a generated C++ stub. Is there any
> > > way to increase the limit? Thanks.

> >
> > No. Why on earth does one need a single string longer than 32K?

>
> Because xlC (5.0.x.y) uses brain-damaged template name mangling
> scheme?
>
> Gilbert didn't write the string himself -- xlC wrote it for him.
>
> Try compiling this test with "xlC -S -g junk.cc"
> Can you guess the length of the longest .stabx ? (answer at the bottom):
>
> --- cut --- junk.cc ---
> struct allocator { };
> struct iterator { };
> template <class T, class R, class I> struct Foo
> {
> int func();
> };
>
> int main()
> {
> typedef int T1;
> typedef Foo<T1, allocator, iterator> T2;
> typedef Foo<T2, allocator, iterator> T3;
> typedef Foo<T3, allocator, iterator> T4;
>
> T4 f;
> f.func();
>
> return 0;
> }
> --- cut --- junk.cc ---
>
> Answer: 186:
> .stabx "Foo<Foo<Foo<int,allocator,iterator>,allocator,ite rator>,allocator,iterator>:T8=Y1sV(u[f:func__3FooXT3FooXT3FooXTiT9allocatorT8iterator_T 9allocatorT8iterator_T9allocatorT8iterator_Fv:2;;" ,0x00,0x8c,0x0
>
> It only takes a "map<string, map<string, map<string, int> > >"
> to produce:
>
> xlC: 1501-224 fatal error in /usr/vac/exe/dis: signal 11 received
>
> The simple "map<string, map<string, int> >" produces a .stabx entry
> of 3624 characters.
>
> Cheers,


The offending code is in a C++ CORBA stub generated by the IDL
compiler. The problem is about string literal, rather than mangled
names generated by the C++ compiler.

Cheers,

Gilbert
Reply With Quote