Help, Compilation problem with C++ 5.0

Help, Compilation problem with C++ 5.0

Post by Sandro Morandin » Thu, 22 Jul 1999 04:00:00



Hello all,

I have some troubles compiling a .c file which was
generated by a parser.

Once compilation is started with ..

CC -compat -I .... -c -PIC file.c

.. nothing happens until all memory is used up, aprox 1GB.

Everything works fine with C++ 4.0 and Solaris7 but we need
to upgrade our tools thats why I downloaded a trial version
of Workshop 5.0 and ...#$?!

I tried to truss the compilation process and this is
the last significant part of the output:

21017:  .....
21017:  .....
21017:  open("/usr/include/alloca.h", O_RDONLY)         = 8
21017:  fstat(8, 0xFFBEE048)                            = 0
21017:  mmap(0x00000000, 1378, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_NORESERVE, 8, 0) = 0xFF350000
21017:  open("/usr/include/sys/types.h", O_RDONLY)      = 9
21017:  fstat(9, 0xFFBEE048)                            = 0
21017:  mmap(0x00000000, 15425, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_NORESERVE, 9, 0) = 0xFF240000
21017:  munmap(0xFF240000, 15425)                       = 0
21017:  close(9)                                        = 0
21017:  brk(0x017B8000)                                 = 0
21017:  brk(0x017BC000)                                 = 0
21017:  ioctl(6, PIOCUSAGE, 0xFFBEE05C)                 = 0
21017:  ioctl(6, PIOCUSAGE, 0xFFBEE05C)                 = 0
21017:  munmap(0xFF350000, 1378)                        = 0
21017:  close(8)                                        = 0
21017:  ioctl(6, PIOCUSAGE, 0xFFBEE05C)                 = 0
21017:  brk(0x017BC000)                                 = 0
21017:  brk(0x017BE000)                                 = 0
21017:  ioctl(6, PIOCUSAGE, 0xFFBEE05C)                 = 0
21017:  brk(0x017BE000)                                 = 0
21017:  brk(0x017C0000)                                 = 0
21017:  brk............                                 = 0
21017:  brk............                                 = 0
21017:  brk............                                 = 0

... and brk() so on until .. out of memory message

Any help would be appreciated.

Thank you,
 Sandro

 
 
 

Help, Compilation problem with C++ 5.0

Post by klin » Thu, 22 Jul 1999 04:00:00



> Hello all,

> I have some troubles compiling a .c file which was
> generated by a parser.

> Once compilation is started with ..

> CC -compat -I .... -c -PIC file.c

> .. nothing happens until all memory is used up, aprox 1GB.

> Everything works fine with C++ 4.0 and Solaris7 but we need
> to upgrade our tools thats why I downloaded a trial version
> of Workshop 5.0 and ...#$?!

[snip]

Quote:> Any help would be appreciated.

> Thank you,
>  Sandro

There is a number of patches available and quite needed to be able to get
reasonable compiling out of WS5.0.
Are you sure that you want (can) to compile the ".c" source with CC?
In "most" cases ".c" files (especially autogenerated ones) are compiled via cc!

/jk

 
 
 

Help, Compilation problem with C++ 5.0

Post by Sandro Morandin » Sat, 24 Jul 1999 04:00:00



> There is a number of patches available and quite needed to be able to get
> reasonable compiling out of WS5.0.
> Are you sure that you want (can) to compile the ".c" source with CC?
> In "most" cases ".c" files (especially autogenerated ones) are compiled via cc!

> /jk

I just installed the newest patches from sun. Still have the same
problem.
... and about ".c" its really C++ code which was generated by our parser
but
due to historical and practical reasons we kept the ".c" extension.
.. and as said everything was working fine with SpacWorks C++ 4.0.

Sandro

 
 
 

Help, Compilation problem with C++ 5.0

Post by Steve Bellen » Sat, 24 Jul 1999 04:00:00




Quote:

>I just installed the newest patches from sun. Still have the same
>problem.
>... and about ".c" its really C++ code which was generated by our parser
>but
>due to historical and practical reasons we kept the ".c" extension.
>.. and as said everything was working fine with SpacWorks C++ 4.0.

Have you tried to compile the file with a .cc extension?
Have you looked at the preprocessor output? (CC -E <same flags> foo > foo.out)
Have you commented out some of the code to find where the loop is?

The jump from 4.0 (and 4.2) to 5.0 is a big one for C++, the old version
trailed the emerging standards by such a distance that the new version
which does the new C++ standard breaks so much there is an old mode
for several things.
--