From owner-cvs-all Sun May 9 16:26:54 1999 Delivered-To: cvs-all@freebsd.org Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (Postfix) with ESMTP id 4711114F2B; Sun, 9 May 1999 16:26:48 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id JAA32555; Mon, 10 May 1999 09:26:46 +1000 Date: Mon, 10 May 1999 09:26:46 +1000 From: Bruce Evans Message-Id: <199905092326.JAA32555@godzilla.zeta.org.au> To: bde@zeta.org.au, grog@lemis.com Subject: Re: cvs commit: src/sys/sys types.h Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, phk@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk >>> Make minor, major and makedev inline functions so we gain type checking >>> and prevent compile time creation of dev_t's from happening again. >> >> You can't do that. It adds gratuitous dependencies on the compiler being >> gcc to the most central header in the system. > >Well, the dependency is on a compiler that understands `inline'. Are >we planning to migrate to one that doesn't in the near future? It I use bcc in regression tests. `inline' (actually `__inline') gets defined away unless the compiler is gcc or supports C++, so the main effect for old compilers is to pessimise the macros into static functions (one copy of each for every file that includes ). The namespace change breaks working code even for gcc. E.g.: --- #include /* %^%^@#%^ defines major(). */ #undef major struct mymajor *major(void); --- >also allows more type checking than a macro. Actually, it allows less type checking than a (gcc) macro. Args are implicitly cast before they are used. Even the old macros detected some type errors. E.g., makedev(1.2, 3.4) was an error; now it is silently converted to makedev(1, 3). The current implementation also requires an ANSI compiler. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message