On Mon, Jul 07, 2008 at 06:11:21PM +0200, Alan Barrett wrote: > On Mon, 07 Jul 2008, Gregory McGarry wrote: > > How should alternative compilers be integrated into the build system? > > Can patches like the one below be sprinkled round the the build tree > > and bsd.own.mk changed later to define HAVE_PCC? > > In general, it would be nice if changes could be centralised, such as by > adding appropriate macros to <sys/cdefs.h>, and having other code use > such macros. I don't mind seeing a maze of #if (this_compiler) && ! > (that_compiler) || (other_compiler) in sys/cdefs.h, but I don't want to > see it replicated in many Makefiles or other headers. > > > +.if defined(HAVE_PCC) > > +CPPFLAGS+= -D_U_="" > > +.elif defined(HAVE_GCC) > > CPPFLAGS+= -D_U_="__attribute__((unused))" > > +.endif > > In this particular case, <sys/cdefs.h> already defines "__unused", and > I think code that makes direct use of __attribute__((unused)) should be > changed to use __unused instead. The point here is that this is 3rd-party code that already uses the _U_ macro internally. So I think the change should just be to have CPPFLAGS use __unused for the definition of _U_. However, this strikes me as odd because cdefs.h uses an empty define for __attribute__(whatever), so I wonder what the initial issue was. -- Quentin Garnier - cube%cubidou.net@localhost - cube%NetBSD.org@localhost "See the look on my face from staying too long in one place [...] every time the morning breaks I know I'm closer to falling" KT Tunstall, Saving My Face, Drastic Fantastic, 2007.
Description: PGP signature