Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Dec 2013 14:36:41 +1100
From:      Kubilay Kocak <koobs.freebsd@gmail.com>
To:        Jakob Breivik Grimstveit <jakob@grimstveit.no>,  FreeBSD Ports mailing list <freebsd-ports@freebsd.org>
Cc:        sahil@FreeBSD.org
Subject:   Re: postfix-current spewing out warnings while building
Message-ID:  <52BE4749.4040703@FreeBSD.org>
In-Reply-To: <CAFVH1KWRO38cxwHLHni1t4hLjUiV19S6uKNGqKhDNfJ363spxQ@mail.gmail.com>
References:  <CAFVH1KWRO38cxwHLHni1t4hLjUiV19S6uKNGqKhDNfJ363spxQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------070104010503060104030801
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 27/12/2013 6:59 PM, Jakob Breivik Grimstveit wrote:
> mail/postfix-current behaves somewhat strange while building, is it
> anything I should correct?
> 
> 
> $ sudo make clean
> make: "/usr/ports/mail/postfix-current/Makefile" line 92: warning: Couldn't
> read shell's output for "/usr/bin/grep -m 1 '^purgestat'
> /etc/mail/mailer.conf || true"
> make[1]: "/usr/ports/mail/postfix-current/Makefile" line 92: warning:
> Couldn't read shell's output for "/usr/bin/grep -m 1 '^purgestat'
> /etc/mail/mailer.conf || true"
> ===>  Cleaning for postfix-current-base-2.11.20131001,4
> make[1]: "/usr/ports/mail/postfix-current/Makefile" line 92: warning:
> Couldn't read shell's output for "/usr/bin/grep -m 1 '^purgestat'
> /etc/mail/mailer.conf || true"
> 
> [...]
> 
> And while building, I get a bunch (probably thousands) of these:
> 
> duplex_pipe.c:8:1: warning: '/*' within block comment [-Wcomment]
> /*
> ^
> duplex_pipe.c:9:1: warning: '/*' within block comment [-Wcomment]
> /*      int     duplex_pipe(fds)
> ^
> duplex_pipe.c:10:1: warning: '/*' within block comment [-Wcomment]
> /*      int     *fds;
> ^
> 
> [...]
> 
> ../../include/argv.h:6:1: warning: '/*' within block comment [-Wcomment]
> /*      argv 3h
> ^
> ../../include/argv.h:7:1: warning: '/*' within block comment [-Wcomment]
> /* SUMMARY
> ^
> ../../include/argv.h:8:1: warning: '/*' within block comment [-Wcomment]
> /*      string array utilities
> ^
> ../../include/argv.h:9:1: warning: '/*' within block comment [-Wcomment]
> /* SYNOPSIS
> ^
> 
> Thank you in advance.
> 

Hi Jakob,

These comment warnings have been observable for as long as I can
remember, though only with postfix ports (not upstream) when also built
with clang.

This is caused by the override of CC and CCARGS, which clobbers the
warnings postfix configures by default. Another instance of these
symptoms, albeit with a slightly different root cause can be seen here:

http://marc.info/?l=postfix-users&m=134260003817238&w=2

The reason behind the override is a policy in the porters handbook that
recommends respecting user-supplied CC, CXX and CFLAGS, which the
postfix ports follow:

http://www.au.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#dads-cc

http://www.au.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#dads-cflags

While the recommendations above are well-intentioned and grounded
(respect user choice & consistent builds), this is one example of where
doing so is at least a POLA violation, but ultimately harmless.

At worst, for other software in the ports tree where upstream authors
customise flags for very good reasons, the results could be functionally
pathological. This is fortunately not the case here, but worth us
considering more broadly.

Attached is a patch (to lang/postfix) which restores the default warning
flags while continuing to respect user-supplied flags. This can likely
be applied to all postfix ports. Maintainer is CC'd.

I've tested it quickly here with the expected results, if you could do
the same and let us know how it goes, that would be great.

Thanks :)

--
koobs


--------------070104010503060104030801
Content-Type: text/plain; charset=windows-1252;
 name="postfix-also-respect-default-warnings-too.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="postfix-also-respect-default-warnings-too.diff"

Index: Makefile
===================================================================
--- Makefile	(revision 337172)
+++ Makefile	(working copy)
@@ -106,7 +106,8 @@
 
 MAKEFILEFLAGS+=	CC="${CC}" OPT="${CFLAGS}"
 
-POSTFIX_CCARGS+=	-DDEF_CONFIG_DIR=\\\"${ETCDIR}\\\" \
+POSTFIX_CCARGS+=	\$$(WARN) \
+			-DDEF_CONFIG_DIR=\\\"${ETCDIR}\\\" \
 			-DDEF_DAEMON_DIR=\\\"${DAEMONDIR}\\\" \
 			-DDEF_COMMAND_DIR=\\\"${PREFIX}/sbin\\\" \
 			-DDEF_SENDMAIL_PATH=\\\"${PREFIX}/sbin/sendmail\\\" \

--------------070104010503060104030801--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52BE4749.4040703>