Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 669746 - mail-mta/nullmailer-2.0-r1 - clang: inject.cc:211:3: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'unsigned int' in initializer list [-Wc++11-narrowing]
Summary: mail-mta/nullmailer-2.0-r1 - clang: inject.cc:211:3: error: non-constant-expr...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2018-10-27 08:00 UTC by moxian
Modified: 2021-06-15 06:02 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info mail-mta/nullmailer (emerge-info.log,5.64 KB, text/plain)
2018-10-27 08:00 UTC, moxian
Details
build.log.gz (build.log.gz,4.11 KB, application/gzip)
2018-10-27 08:02 UTC, moxian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description moxian 2018-10-27 08:00:28 UTC
Created attachment 553288 [details]
emerge --info mail-mta/nullmailer

From the compile log:

<...>
clang++ -DHAVE_CONFIG_H -I. -I..  -I../lib -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -O2 -pipe -fno-rtti -fno-except
ions -W -Wall -c -o smtpd.o smtpd.cc
inject.cc:211: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(Sender,            T,F,F,F,F), // 0
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
inject.cc:207:38: note: expanded from macro 'X'
#define X(N,IA,IR,IS,IRS,R) { #N ":",strlen(#N ":"),\
                                     ^~~~~~~~~~~~~~
inject.cc:211:3: note: insert an explicit cast to silence this issue
  X(Sender,            T,F,F,F,F), // 0
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
inject.cc:207:38: note: expanded from macro 'X'
#define X(N,IA,IR,IS,IRS,R) { #N ":",strlen(#N ":"),\
                                     ^~~~~~~~~~~~~~
<...>

The package emerges fine with gcc

$ clang --version
clang version 5.0.2 (tags/RELEASE_502/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/5/bin

$ gcc --version
gcc (Gentoo 6.4.0-r1 p1.3) 6.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 1 moxian 2018-10-27 08:02:30 UTC
Created attachment 553290 [details]
build.log.gz
Comment 2 Larry the Git Cow gentoo-dev 2021-06-15 06:02:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a9fee5c109c671e034d31127ea59d988ab15f5fb

commit a9fee5c109c671e034d31127ea59d988ab15f5fb
Author:     Theo Anderson <telans@posteo.de>
AuthorDate: 2021-01-17 10:25:02 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2021-06-15 06:02:06 +0000

    mail-mta/nullmailer: fix build with clang (c++11)
    
    Closes: https://bugs.gentoo.org/669746
    Package-Manager: Portage-3.0.13, Repoman-3.0.2
    Signed-off-by: Theo Anderson <telans@posteo.de>
    Closes: https://github.com/gentoo/gentoo/pull/19088
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 .../nullmailer/files/nullmailer-2.2-c++11.patch    | 36 ++++++++++++++++++++++
 mail-mta/nullmailer/nullmailer-2.2-r1.ebuild       |  1 +
 2 files changed, 37 insertions(+)