bug-gnulib
[Top][All Lists]
Advanced

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

different CFLAGS for gnulib code?


From: Bruno Haible
Subject: different CFLAGS for gnulib code?
Date: Fri, 15 Jan 2021 09:55:12 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; )

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 via email to

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