DragonFly BSD
DragonFly commits List (threaded) for 2006-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/sys/net rtsock.c src/sys/netproto/atalk at_proto.c src/sys/netproto/ipx ipx_proto.c src/sys/netproto/natm natm_proto.c


From: Sascha Wildner <saw@xxxxxxxxx>
Date: Mon, 23 Oct 2006 10:45:51 +0200

Matthew Dillon wrote:
    If these were previously static and worked, then perhaps the
    solution is to remove the extern's rather then make the static
    declarations global.

If I remove the externs then GCC 4.1 will choke on routedomain being referenced in the routesw declaration before it's known. The problem is that routesw and routedomain reference each other, and the extern tries to compensate for that.


Here's the code in question (from sys/net/rtsock.c) before my commit, in case someone has a better idea:

---------->8----------
extern struct domain routedomain;               /* or at least forward */

static struct protosw routesw[] = {
{ SOCK_RAW,     &routedomain,   0,              PR_ATOMIC|PR_ADDR,
  0,            route_output,   raw_ctlinput,   0,
  cpu0_soport,
  raw_init,     0,              0,              0,
  &route_usrreqs
}
};

static struct domain routedomain = {
        PF_ROUTE, "route", NULL, NULL, NULL,
        routesw, &routesw[(sizeof routesw)/(sizeof routesw[0])],
};
----------8<----------

Sascha

--
http://yoyodyne.ath.cx



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]