Date: Thu, 16 Aug 2001 11:01:53 -0700 (PDT) From: Julian Elischer <julian@elischer.org> To: Bruce Evans <bde@zeta.org.au> Cc: net@FreeBSD.ORG Subject: Re: IPV6/KAME/protosw integration cleanup Message-ID: <Pine.BSF.4.21.0108161057240.18201-100000@InterJet.elischer.org> In-Reply-To: <20010816180314.P27152-100000@besplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 16 Aug 2001, Bruce Evans wrote: > > I will not be doing any changes that affect them, Though I may still add > > the prototype definitions in protsw.h as that's a generally useful thing > > to do. > > I think those are the least useful of your changes. They are certainly > the most intrusive if the function typedefs are actually used. yes but the rest of them have been argued against by the KAME folk and I have agreed to let them do it.. (which changes in specific terms, are you refering to?) > > The corresponding function typedefs for the cdevsw functions are even > less useful since all the cdevsw's are now static and the prototypes > can't be used in function bodies (except for variants which give the > args in a list like SYSCTL_HANDLER_ARGS, but don't go there). In most > cases, forward declarations of the cdevsw functions aren't necessary > provided we move the cdevsw data declarations after all the function > bodies. I normally dislike shuffling code to avoid forward declarations, > and like to forward-declare even static functions that are defined > before they are used (since this gives an easy to find list of the > functions and doesn't depend on the order of the function bodies), but > the cdevsw data declaration already provides a lot of structure including > a list of all the cdevsw functions, so I don't mind making a special > case for it. It's normal to use a similar hack for modules (put > DRIVER_MODULE() declarators at the end). The good thing about the typedefs is that if you change them, then you automatically change all teh prototypes that use them, which means that when you compile, you get failures on all teh functions that mismatch their prototypes which means that you HAVE to fix all the mismatching functions. Without them you just get warning messages on the structure initialisations, which you can easily miss, or ignore.. > > Protosw's are still externed, so more declarations are needed, but > that should change. That is not really relevent to what I'm describing above. > > Bruce > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0108161057240.18201-100000>