Re: [dev] [PATCH][blind] alloca #include for BSDs

From: Anthony J. Bentley <anthony_AT_anjbe.name>
Date: Mon, 29 Jan 2018 03:15:17 -0700

Nick writes:
> Quoth Yuri:
> > You should also change your config.mk files to allow external optimization
> > and other flags. For example:
> >
> > > CFLAGS = -std=c99 -Wall -pedantic -O2
> >
> > should be changed to
> >
> > > CFLAGS ?= -O2
> >
> > > CFLAGS += -std=c99 -Wall -pedantic -O2
> >
> > This way you can allow externally supplied optimization flags while still
> > being able to add your own flags. Same with CPPFLAGS and LDFLAGS.
>
> I believe the reason suckless projects stick to = rather than += or
> ?= is that they aren't POSIX / OSI standard. I don't think there's a
> compelling reason to switch to your syntax, as distribution builders
> or whoever can still easily see what the CFLAGS were and add to them
> if they want or need to.

Variables set with = can easily be overridden by packagers simply by
passing them as arguments to make(1).

That's fine for warnings and optimization flags since changing them
doesn't hurt anything. If -std=c99 is necessary for the build, it
shouldn't be in CFLAGS at all for that reason.
Received on Mon Jan 29 2018 - 11:15:17 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 29 2018 - 11:24:22 CET