Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!ucsd!ucsdhub!hp-sdd!hplabs!hp-ses!hpcuhb!hpcllla!hpclisp!hpclwjm!walter From: walter@hpclwjm.HP.COM (Walter Murray) Newsgroups: comp.lang.c Subject: Re: Problem with Geometry Handler definition syntax, X11R3 Message-ID: <660068@hpclwjm.HP.COM> Date: 28 Dec 89 18:38:28 GMT References: <1989Dec27.221725.9951@tolerant.com> Organization: Hewlett-Packard Calif. Language Lab Lines: 32 Geoffrey Leach writes: [abridged to conserve bandwidth] > typedef enum { XtGeometryYes } XtGeometryResult; > typedef XtGeometryResult (*XtGeometryHandler)(); > typedef struct _CompositeClassPart { > XtGeometryHandler geometry_manager; > } CompositeClassPart; > extern XtGeometryHandler foo(); > CompositeClassPart ccp = { foo }; > /* > ** And the result from the SVR3.2.2 cc is the warning: > ** warning: illegal pointer combination, op = > ** The key to the complaint appears to be the fact that the > ** typedef is a pointer to a procedure returning an enum. > ** Is this a peculiarity of ATT's cc? Anyone know of a workaround? > */ ---------- No, the compiler is correct. The code is illegal. Some compilers won't complain; some will. Any ANSI-conforming compiler should complain. My guess is that you didn't declare foo() the way you meant to. Perhaps you meant: extern XtGeometryResult foo(); Warning: I know nothing about the Xt intrinsics. This is just a guess. Walter Murray ---