[comp.lang.c++] What does "munch" in C++ and/or Concurrent C do?

scott@rdahp.UUCP (Scott Hammond) (03/29/89)

Can someone enlighten me as to what "munch" does for C++ and/or
for Concurrent C?  I know it performs some sort of manipulations
on the object file but that's all I know.  It also seems to add
a lot to compile time and I want to know if I can do without it.

I'm actually specifically interested in Concurrent C, but since
it uses nearly the same parser as C++, I gather that "munch" is
doing the same thing for both.  Thanks for any information.
My apologies if this is a naive question.
--
Scott Hammond,  R & D Associates, Marina del Rey, CA  (213) 822-1715
: {ksuvax1,zardoz}!rdahp!scott
:  rdahp!scott@ksuvax1.cis.ksu.edu
:  scott@harris.cis.ksu.edu

adc@cpsvax.cps.msu.edu (Alan Cabrera) (03/30/89)

In article <220@rdahp.UUCP> scott@rdahp.UUCP (Scott Hammond) writes:
>Can someone enlighten me as to what "munch" does for C++ and/or
>for Concurrent C?  I know it performs some sort of manipulations
>on the object file but that's all I know.  It also seems to add
>a lot to compile time and I want to know if I can do without it.


I am also interested.  I've installed AT&T C++, Release 1.2 on my Sun
running SunOS 3.5, and the compiler seems to barf when munch is
invoked.  The message that I get is

	11694 Memory fault - core dumped

I ran the bsd.fix shell.  Do I need to do more?


Alan Cabrera
adc@cpsvax.cps.msu.edu

jayaram@sun602.uucp (Jayaram Kalpathy) (03/31/89)

If I remember correctly, munch is the part that goes through all the .o's
that are being loaded, finds out what global classes are declared that
need to have constructors called and then sticks in the code that invokes
these constructors before `main'.

It does slow down the compile terribly. At Data General, we had a version of
the C++ compiler that built up a list of all these constructors into a
function called, say, foo_file_x() for the file file_x.o so that all you
had to do at link time was to make the stuff in _main call all these
functions.

One problem that AT&T C++ V1.2 had was that if you had global class
variables defined in a file that had only variables and NO CODE, the
constructors for these would not get called since the .o was never
linked in !!!

russo@chaos.utexas.edu (Tom Russo) (04/01/89)

I too have this problem with munch. I'm trying to get the compiler ported
to our SGI Iris 4 Server 8 and the darned thing barfs when munch is invoked.
I have poked around and found that it does so when it does a getchar() the
second time. Anyone tried to port AT&T C++ to this type of system?



Thomas Russo
Center for Nonlinear Dynamics
University of Texas at Austin
-----------------------------
russo@chaos.utexas.edu
--tvr
------

schmidt@glacier.ics.uci.edu (Doug Schmidt) (04/01/89)

In article <11630@ut-emx.UUCP> russo@chaos.ut.UUCP (Tom Russo) writes:
++ I too have this problem with munch. I'm trying to get the compiler ported
++ to our SGI Iris 4 Server 8 and the darned thing barfs when munch is invoked.
++ I have poked around and found that it does so when it does a getchar() the
++ second time. Anyone tried to port AT&T C++ to this type of system?

Compare the order of struct _iobuf fields in the SGI stdio.h with that
from the CC distribution.  I'll bet they are subtly different.  I had
this *exact* problem when porting CC to our sun 4 network.

   Doug
--
On a clear day, under blue skies, there is no need to seek.
And asking about Buddha                +------------------------+
Is like proclaiming innocence,         | schmidt@ics.uci.edu    |
With loot in your pocket.              | office: (714) 856-4043 |