Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* cc -proto[is] produces fubar results?
@ 1996-03-10  5:00 John Hascall
  1996-03-12  5:00 ` Tom Carlson
  0 siblings, 1 reply; 3+ messages in thread
From: John Hascall @ 1996-03-10  5:00 UTC (permalink / raw)


(I get identical results under Ultrix V4.3a and Digital Unix V3.2a)

Doing: "cc -protoi sample.c" (see sample.c below) gives a sample.H of:

extern int (int (* )argc , char * * argv)ifunc(struct xcmd * tbl , char * item);

It seems to me that this isn't even close to legal C, right?

------------------------------- sample.c ---------------------------------
struct xcmd {
        char *  xc_name;
        int (*  xc_ifunc)();
};

/*
 * declare ifunc as function (tbl as pointer to struct xcmd,
 *                            item as pointer to char) returning
 *       pointer to function (argc as int,
 *                            argv as pointer to pointer to char) returning int
 */
int ( * ifunc (
        struct xcmd *   tbl,
        char *          item
) ) (
        int     argc,
        char ** argv
) {
        struct xcmd *   xc;

        for (xc = tbl; xc->xc_name != (char*)0; ++xc) {
                if (strcasecmp(item, xc->xc_name) == 0) break;
        }
        return xc->xc_ifunc;
}
-------------------------------------------------------------------------------
-- 
John Hascall                ``An ill-chosen word is the fool's messenger.''
Moderator, comp.unix.wizards
Systems Software Engineer, ISU Comp Center + Ames, IA  50011 + 515/294-9551
<a href="http://www.cc.iastate.edu/staff/systems/john/">My Homepage</a>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1996-03-13  5:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-03-10  5:00 cc -proto[is] produces fubar results? John Hascall
1996-03-12  5:00 ` Tom Carlson
1996-03-13  5:00   ` Jeff Zeeb DEC C

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox