lmi
[Top][All Lists]
Advanced

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

Re: [lmi] [lmi-commits] master e4abb6e1 14/17: Don't specify nonempty $C


From: Vadim Zeitlin
Subject: Re: [lmi] [lmi-commits] master e4abb6e1 14/17: Don't specify nonempty $CFLAGS or $CXXFLAGS
Date: Sun, 3 Jul 2022 19:36:11 +0200

On Sat,  2 Jul 2022 21:42:15 -0400 (EDT) Greg Chicares 
<gchicares@sbcglobal.net> wrote:

GC> branch: master
GC> commit e4abb6e1f94c84a24343689f625004609354c8a5
GC> Author: Gregory W. Chicares <gchicares@sbcglobal.net>
GC> Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
GC> 
GC>     Don't specify nonempty $CFLAGS or $CXXFLAGS
GC>     
GC>     The GNU coding standards
GC>       https://www.gnu.org/prep/standards/html_node/Command-Variables.html
GC>     suggest specifying "CFLAGS = -g" in makefiles. Until now, lmi had
GC>     followed that rule (if not quite literally) by setting $CFLAGS and
GC>     $CXXFLAGS to a default value of '-ggdb'. Now, this makefile assigns
GC>     them no value, so that overriding them doesn't discard any default.

 FWIW there is also a school of thought which says that these flags should
never be overridden, but only appended to. I'm relatively sympathetic to
this idea because it's not nice when you're trying to compile some package
with "make CPPFLAGS=-I/some/path/to/non/system/headers" only for the build
to fail because the flags get clobbered somewhere in the makefiles. And it
still allows overriding the optimization flags just as easily, knowing that
only the last -Ox occurrence is taken into account.

 So perhaps there should be no assignments to C*FLAGS and += should always
be used for them?

VZ

Attachment: pgpLWDYw86AUs.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]