cc compiler syntax error-- cause sought

Joe Vaughan jkv at air.atmo.arizona.edu
Wed Jul 22 19:50:30 EDT 1992


Here is a description of the problem I'm
having.
I am working in a DEC Ultrix workstation
environment.
I am trying to make ( compile and link ) the
xgen code within GRASS.
The xgen code uses motif, which is apparently
what is stored in the Xm area. 
I get the following log from the make
attempt:

*** mklog ***
cc -O -DBSD  -I.  -c addnode.c
cc -O -DBSD  -I.  -c allcapture.c
cc -O -DBSD  -I.  -c alloctypes.c
cc -O -DBSD  -I.  -c button.c
cc -O -DBSD  -I.  -c buttonname.c
cc -O -DBSD  -I.  -c buttonpush.c
cc -O -DBSD  -I.  -c check.c
cc -O -DBSD  -I.  -c clear.c
cc -O -DBSD  -I.  -c client.c
cc -O -DBSD  -I.  -c cmdboard.c
cc -O -DBSD  -I.  -c command.c
cc -O -DBSD  -I.  -c control.c
cc -O -DBSD  -I.  -c createobj.c
cc -O -DBSD  -I.  -c creatshell.c
cc -O -DBSD  -I.  -c destshell.c
cc -O -DBSD  -I.  -c doactions.c
cc -O -DBSD  -I.  -c docapture.c
cc -O -DBSD  -I.  -c dodup.c
cc -O -DBSD  -I.  -c doerror.c
cc -O -DBSD  -I.  -c doexec.c
cc -O -DBSD  -I.  -c dointer.c
cc -O -DBSD  -I.  -c dojobs.c
cc -O -DBSD  -I.  -c doset.c
cc -O -DBSD  -I.  -c editor.c
cc -O -DBSD  -I.  -c error.c
cc -O -DBSD  -I.  -c exit.c
cc -O -DBSD  -I.  -c expand.c
cc -O -DBSD  -I.  -c expandobj.c
cc -O -DBSD  -I.  -c expandvar.c
yacc -d grammar.y
mv y.tab.c grammar.c
cc -O -DBSD  -I.  -c grammar.c
cc -O -DBSD  -I.  -c help.c
cc -O -DBSD  -I.  -c index.c
cc -O -DBSD  -I.  -c initshell.c
cc -O -DBSD  -I.  -c label.c
lex  lex.l
mv lex.yy.c lex.c
cc -O -DBSD  -I.  -c lex.c
cc -O -DBSD  -I.  -c list.c
cc -O -DBSD  -I.  -c listchng.c
cc -O -DBSD  -I.  -c listdata.c
cc -O -DBSD  -I.  -c main.c
cc -O -DBSD  -I.  -c menu.c
cc -O -DBSD  -I.  -c message.c
cc -O -DBSD  -I.  -c msgboard.c
cc -O -DBSD  -I.  -c multiline.c
cc -O -DBSD  -I.  -c objectargs.c
cc -O -DBSD  -I.  -c objectval.c
cc -O -DBSD  -I.  -c parsecom.c
cc -O -DBSD  -I.  -c popup.c
cc -O -DBSD  -I.  -c procmess.c
cc -O -DBSD  -I.  -c pulldown.c
cc -O -DBSD  -I.  -c resource.c
cc -O -DBSD  -I.  -c sensitive.c
cc -O -DBSD  -I.  -c separator.c
cc -O -DBSD  -I.  -c signal.c
cc -O -DBSD  -I.  -c slider.c
cc -O -DBSD  -I.  -c strpart.c
cc -O -DBSD  -I.  -c table.c
cc -O -DBSD  -I.  -c tableact.c
cc -O -DBSD  -I.  -c textact.c
cc -O -DBSD  -I.  -c textentry.c
cc -O -DBSD  -I.  -c toggle.c
cc -O -DBSD  -I.  -c togglechng.c
cc -O -DBSD  -I.  -c toggledata.c
cc -O -DBSD  -I.  -c token.c
cc -O -DBSD  -I.  -c unique.c
cc -O -DBSD  -I.  -c update.c
cc -O -DBSD  -I.  -c warning.c
cc -O -DBSD  -I.  -c yesno.c
cc -O -DBSD  -I.  -c Matrix.c
ccom: Error: /usr/include/Xm/XmP.h, line 643:
syntax error
         RectObjClassPart  rect_class;
      ------------------^
(ccom): /usr/include/Xm/XmP.h, line 643:
cannot recover from earlier errors: goodbye!
         RectObjClassPart  rect_class;
      ------------------------------^
*** Error code 1

Stop.
*** end of mklog ***


Here is the declaration from XmP.h that the
compiler seems to be
complaining about:

/*  Full class record declaration for Gadget
class  */

typedef struct _XmGadgetClassRec
{
   RectObjClassPart  rect_class;
   XmGadgetClassPart gadget_class;
} XmGadgetClassRec;

externalref XmGadgetClassRec
xmGadgetClassRec;

Since I've had two days  of training in C I
interpret the above fragment
to define a type, that type being a structure
of two entities,
rect_class and gadget_class, of types
RectObjClassPart and
XmGadgetClassPart respectively.  The type
being defined will be called
_XmGadgetClassRec, and XmGadgetClassRec is
declared to be an instance
or occurance of that newly defined type.

What does 'externalref ... ' do?  My
documentation doesn't define the
command 'externalref', but it does define
'globalref'.  Since the
variable XmGadgetClassRec has been defined to
be an instance of the 
type just defined, it seems strange to then
have the 'externalref'
saying that the variable XmGadgetClassRec
should be found as a
'external' from another module.  What is
going on here?
Do you see the syntax error the compiler
complains about?

Where are the two types, RectObjClassPart and
XmGadgetClassPart,
defined?  Well, just above the code flagged
as being in error is...


/*  Gadget class structure  */

typedef Boolean (*XmVisualChangeProc)();  /*
returns TRUE if redisplay */
/* XmGadget child           */
/* XmManagerWidget current  */
/* XmManagerWidget new      */

typedef struct _XmGadgetClassPart
{
   XtWidgetProc         border_highlight;
   XtWidgetProc         border_unhighlight;
   XtProc               arm_and_activate;
   XtWidgetProc         input_dispatch;
   XmVisualChangeProc   visual_change;
   XmSyntheticResource * syn_resources;
  
   int                  num_syn_resources;
  
   XmCacheClassPartPtr	cache_part;
   caddr_t		extension;
} XmGadgetClassPart;
which seems to define a variable
XmGadgetClassPart as an instance of
the structure _XmGadgetClassPart.
Question, is the occurance of the asterisk in
the struct above defining
a pointer?  I thought no whitespace could
follow an indirection
operator?  Isn't that what I see happening?

I don't see anywhere in the same include
header file where
RectObjClassPart is defined.  So maybe I need
to look through
all the other header files included in this
module before the inclusion
of XmP.h?
I don't find evidence of RectObjClassPart in
the other header files
referenced before XmP.h is included, nor in
those include by XmP.h .

General Question:  Is there a tool to
identify the dependents'
relationship ( in terms of these definitions
which require inclusion of
other header files ) for a body of header
files.  For example, is there
a tool to tell me what all the header files
are that I need to include
to have a successful compile if I'm going to
include XmP.h, or going to
use RectObjClassPart ??

Finally, can anyone tell me what the uil
compiler is for-- it apparently
relates to motif somehow?

Any ideas or leads are welcome -- thank you

Joe Vaughan
jkv at air.atmo.arizona.edu






More information about the grass-dev mailing list