PCC internals question

Jonathan Leech leech at alanine.cs.unc.edu
Fri Sep 23 09:24:12 AEST 1988


    I'm modifying lint pass 1 to generate function prototypes in
human-readable form. Just about everything works, with one flaw:
typedef names are resolved into the underlying type. That is, if I
have

	typedef struct _int { int i; } INT;
	INT *i;

    and feed it to my modified lpass1, it comes out with

	struct _int *i;

    rather than the original definition. This would be acceptable,
but if I have something like

	typedef struct { int i; } INT;

    PCC does not make the tag information available (in the extra1
member of ATYPE structures) at all, so I can't tell what variables of
that type should be called.

    What I have done was modify the places in lint.c where
information was being written in binary form, e.g. the 'union rec'
and ATYPE structures. But by the time they're written, the typedef
information is no longer directly available, and I don't know where
to find it. Can anyone on the net give me some pointers (by email,
please) so an afternoon project doesn't turn into a week?

    The PCC version we have is "PCC/2.1 (Berkeley) 4/23/86" from the
mt Xinu 4.3 release.

    Thanks!
--
    Jon Leech (leech at cs.unc.edu)    __@/
    ``My goal is simple. It is complete understanding of the universe,
      why it is as it is and why it exists at all.''
	- Stephen Hawking



More information about the Comp.unix.wizards mailing list