[comp.unix.questions] Trouble with cxref

jeff@cjsa.WA.COM (Jeffery Small) (02/03/90)

I have been unable to get cxref(1) to work.  I am attempting to run this on
a set of program files which compile and lint clean.  I have tried all manner
of invocations with no improvement so I am tossing this out for comments.

A typical invocation would be:     cxref -c -o xref   *.c

On an AT&T 3B1/UNIX-PC (3.51 OS), I get the following messages:

    /usr/include/curses.h:  8: undefined control
    /usr/include/unctrl.h:  8: undefined control
    xcpp failed on <MyFileName.c>!

and cxref aborts.  Looking at these include files shows that line #8 is:

    #ident "@(#) ..... etc ...."

OK:  it doesn't like "#ident", but I don't think this is causing the abort
which occurs in my source file.


Now, on a Sun-3/60 (4.0.3 OS) using either /bin/cxref of /usr/5bin/cxref,
I get the following message:

    SWITCH ERROR IN TMPSCAN: inafunct = no

and cxref aborts.  Does anyone have any idea what I am doing wrong or what
problems I should be looking for?

Thanks.
--
Jeff Small                     C. Jeffery Small & Associates    (206) 485-5596
uunet!nwnexus!cjsa!jeff        19112 152nd Avenue NE, Woodinville, WA    98072

leo@aai.uu.net (Leo Pinard) (02/11/90)

In article <2019@cjsa.WA.COM> jeff@cjsa.WA.COM (Jeffery Small) writes:
>I have been unable to get cxref(1) to work.  I am attempting to run this on
>a set of program files which compile and lint clean.  I have tried all manner
>of invocations with no improvement so I am tossing this out for comments.
>
>Now, on a Sun-3/60 (4.0.3 OS) using either /bin/cxref of /usr/5bin/cxref,
>I get the following message:
>
>    SWITCH ERROR IN TMPSCAN: inafunct = no
>
>and cxref aborts.  Does anyone have any idea what I am doing wrong or what
>problems I should be looking for?

I posted a question about this recently and got an answer for the Sun, at
least.  Jim Litchfield sent me the answer (Thanks, Jim!).  It's a bug in cpp
that can be worked around by running cpp separately, and then cxref.  I use the
following script:

#! /bin/csh
foreach name (*.c)
/usr/lib/cpp -Dunix -Dsun -Dsparc $name >${name:r}.cref.c
end
cxref -cst -o rpe.cref *.cref.c 
foreach name (*.cref.c)
\rm $name
end

To find out what options to pass the compiler, do a cc -dryrun.  The bug is
supposedly fixed in 4.1.

Leo Pinard  leo@aai.uu.net