bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org, noloader@gmail.com
Cc: Simon Josefsson <simon@josefsson.org>,
	Paul Eggert <eggert@cs.ucla.edu>,
	Alexandre Duret-Lutz <adl@lrde.epita.fr>,
	Jim Meyering <jim@meyering.net>, Paul Smith <psmith@gnu.org>,
	Akim Demaille <akim.demaille@gmail.com>
Subject: different CFLAGS for gnulib code?
Date: Fri, 15 Jan 2021 09:55:12 +0100	[thread overview]
Message-ID: <2567810.aDiGfSFVrs@omega> (raw)
In-Reply-To: <CAH8yC8mVcWFEpjcOoWrxktZQeBr4gDnnsAxbBssxxM38TVShSg@mail.gmail.com>

Hi,

Jeffrey Walton wrote:
> Perhaps it would be a good idea to filter-out the options that you
> don't want present for Gnulib.
> 
> If you are doing it during configure, then take the user's CFLAGS (or
> CXXFLAGS) and then:
> 
>        TCFLAGS=`echo $CFLAGS | sed -e 's/-Wall//g' -e 's/-Wextra//g'
> -e 's/-Werror//g'`
> 
> If you are doing it during make, then use a recipe like this for Gnulib sources:
> 
>     GL_CFLAGS := $(filter-out -Wall -Wextra -Werror% -Wunused
> -Wconversion -Wp%, $(CFLAGS))
>     ...
>     %.o:%.c:
>         $CC $(strip $CPPFLAGS $GL_CFLAGS -c) $<
> 
> That will put an end to these mailing list messages and bug reports.
> You get what you want, and users get what they want.
> 
> Otherwise, this is an exercise in insanity. Users keep doing the same
> thing, GNU keeps doing the same thing, but everyone expects a
> different outcome. Instead of practicing inanity, engineer a fix for
> the problem.

It is an interesting idea. Leaving the question aside how it is implemented
(through an AC_SUBSTed variable or what else), the main question is: Would
some GNU package maintainers want this?

I always thought that GNU package maintainers want their entire package to
be compiled with the same CFLAGS and CPPFLAGS. Would compiling the gnulib
part with options for fewer warnings be OK with you?

Paul, Pádraig, Jim, Paul, Akim, Simon, all: what's your opinion?

Bruno



  reply	other threads:[~2021-01-15  8:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 10:37 clang++ 11 compilation issues Alexandre Duret-Lutz
2021-01-12 18:23 ` Florian Weimer
2021-01-13 11:31   ` Alexandre Duret-Lutz
2021-01-12 20:19 ` Bruno Haible
2021-01-13 21:04   ` Jeffrey Walton
2021-01-15  8:55     ` Bruno Haible [this message]
2021-01-15  9:20       ` different CFLAGS for gnulib code? Alexandre Duret-Lutz
2021-01-15 11:11       ` Paul Eggert
2021-01-15 16:36         ` Darshit Shah
2021-01-15 11:17       ` Simon Josefsson via Gnulib discussion list
2021-01-15 16:08       ` Jim Meyering
2021-01-17 12:55       ` Pádraig Brady
2021-01-14  0:37   ` clang++ 11 compilation issues Paul Eggert
2021-01-14  1:21     ` Bruno Haible
2021-01-14  1:55       ` Paul Eggert
2021-01-14  2:09         ` Bruno Haible
2021-01-14 18:21   ` Alexandre Duret-Lutz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2567810.aDiGfSFVrs@omega \
    --to=bruno@clisp.org \
    --cc=adl@lrde.epita.fr \
    --cc=akim.demaille@gmail.com \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=jim@meyering.net \
    --cc=noloader@gmail.com \
    --cc=psmith@gnu.org \
    --cc=simon@josefsson.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).