Bug 230496

Summary: mail/nullmailer: Fails to build with Clang 6.0
Product: Ports & Packages Reporter: Tod McQuillin <devin>
Component: Individual Port(s)Assignee: Tobias Kortkamp <tobik>
Status: Closed FIXED    
Severity: Affects Some People CC: devin, koobs, ndowens04
Priority: --- Keywords: easy, needs-qa
Version: LatestFlags: tobik: merge-quarterly+
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224669
Attachments:
Description Flags
Full build log showing errors
none
Patch to allow building with clang 6.0 koobs: maintainer-approval+

Description Tod McQuillin 2018-08-10 08:29:47 UTC
Created attachment 196049 [details]
Full build log showing errors

Building with clang 6.0 generates many errors and the build does not succeed.

For example:

inject.cc:216:3: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'unsigned int' in initializer list [-Wc++11-nar
rowing]
  X(Sender,            T,F,F,F,F), // 0
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
inject.cc:212:38: note: expanded from macro 'X'
#define X(N,IA,IR,IS,IRS,R) { #N ":",strlen(#N ":"),\
                                     ^~~~~~~~~~~~~~
Comment 1 Tod McQuillin 2018-08-10 08:31:18 UTC
Created attachment 196050 [details]
Patch to allow building with clang 6.0

Adding -std=c++03 to CXXFLAGS allows the build to complete with clang 6.0.

Patch attached.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2018-08-10 10:30:55 UTC
Thank you Todd
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2018-08-10 10:31:19 UTC
Comment on attachment 196050 [details]
Patch to allow building with clang 6.0

Approved by: portmgr (unmaintained port)

Pending QA
Comment 4 Nathan 2018-08-28 01:46:21 UTC
Tested, using USE_CXXSTD=c++03 which ends up being the same as patch, worked on 11.2( which uses clang 6.1(supposedly, I think it's actually showing my host's version, but could not be as 10.4 shows 3.x )
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-11-08 13:46:34 UTC
A commit references this bug:

Author: tobik
Date: Thu Nov  8 13:45:53 UTC 2018
New revision: 484453
URL: https://svnweb.freebsd.org/changeset/ports/484453

Log:
  mail/nullmailer: Unbreak build with Clang 6 (C++14 by default)

  inject.cc:221:3: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'unsigned int' in initializer list [-Wc++11-narrowing]
    X(Errors-To,         T,F,F,F,F), // 5
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  http://beefy12.nyi.freebsd.org/data/head-amd64-default/p483866_s340093/logs/nullmailer-1.13_3,1.log

  PR:		230496
  Submitted by:	Tod McQuillin <devin@spamcop.net>

Changes:
  head/mail/nullmailer/Makefile
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-11-08 13:47:37 UTC
A commit references this bug:

Author: tobik
Date: Thu Nov  8 13:46:45 UTC 2018
New revision: 484454
URL: https://svnweb.freebsd.org/changeset/ports/484454

Log:
  MFH: r484453

  mail/nullmailer: Unbreak build with Clang 6 (C++14 by default)

  inject.cc:221:3: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'unsigned int' in initializer list [-Wc++11-narrowing]
    X(Errors-To,         T,F,F,F,F), // 5
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  http://beefy12.nyi.freebsd.org/data/head-amd64-default/p483866_s340093/logs/nullmailer-1.13_3,1.log

  PR:		230496
  Submitted by:	Tod McQuillin <devin@spamcop.net>

  Approved by:	ports-secteam blanket

Changes:
_U  branches/2018Q4/
  branches/2018Q4/mail/nullmailer/Makefile