Bug 240457 - chinese/pyzy: Fix build on powerpc64
Summary: chinese/pyzy: Fix build on powerpc64
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: powerpc Any
: --- Affects Some People
Assignee: Piotr Kubaj
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-09 19:52 UTC by Piotr Kubaj
Modified: 2019-09-12 17:16 UTC (History)
2 users (show)

See Also:
henry.hu.sh: maintainer-feedback+


Attachments
patch (6.54 KB, patch)
2019-09-09 19:52 UTC, Piotr Kubaj
no flags Details | Diff
v2 (7.33 KB, patch)
2019-09-09 20:38 UTC, Piotr Kubaj
pkubaj: maintainer-approval? (henry.hu.sh)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer freebsd_triage 2019-09-09 19:52:39 UTC
Created attachment 207335 [details]
patch

Add explicit signed to char to fix build on powerpc64.

./DoublePinyinTable.h:166:5: error: constant expression evaluates to -1 which cannot be narrowed to type 'char' [-Wc++11-narrowing]
Comment 1 Piotr Kubaj freebsd_committer freebsd_triage 2019-09-09 19:54:10 UTC
It also probably fixes build on ARM architectures.

.if ${CHOSEN_COMPILER_TYPE} == gcc
CXXFLAGS+=      -Wno-error=narrowing
.endif
can now probably be removed.
Comment 2 Piotr Kubaj freebsd_committer freebsd_triage 2019-09-09 20:38:30 UTC
Created attachment 207337 [details]
v2

I have verified this also fixes build on ARM.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2019-09-09 23:27:15 UTC
Approved as mentor (builds on ppcports).
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2019-09-10 01:56:06 UTC
^Triage: Reporter is committer, assign accordingly
Comment 5 Henry Hu 2019-09-11 03:17:43 UTC
The patch seems fine. I don't have an ARM/PowerPC environment to test it, so as long as it works fine at your side, it should be okay.
AFAIK, "signed" is the default for integer types in C++. Out of curiosity, would you please explain why adding "signed" fixed the compilation issue? Thanks.
Comment 6 Piotr Kubaj freebsd_committer freebsd_triage 2019-09-11 05:10:32 UTC
(In reply to Henry Hu from comment #5)
I'm not sure how it is on ARM, but on ppc64 char is unsigned by default.
Comment 7 Mikael Urankar freebsd_committer freebsd_triage 2019-09-11 07:08:04 UTC
(In reply to Piotr Kubaj from comment #6)
It's unsigned on arm*, see arch(7) Endianness and Char Signedness
Comment 8 commit-hook freebsd_committer freebsd_triage 2019-09-11 12:43:06 UTC
A commit references this bug:

Author: pkubaj
Date: Wed Sep 11 12:42:54 UTC 2019
New revision: 511821
URL: https://svnweb.freebsd.org/changeset/ports/511821

Log:
  chinese/pyzy: Fix build on powerpc64, aarch64 and armv*

  Add explicit signed to char to fix build where char is unsigned.
  ./DoublePinyinTable.h:166:5: error: constant expression evaluates to -1 which cannot be narrowed to type 'char' [-Wc++11-narrowing]

  PR:		240457
  Approved by:	linimon (mentor), henry.hu.sh@gmail.com (maintainer)

Changes:
  head/chinese/pyzy/files/patch-src_DoublePinyinContext.cc
  head/chinese/pyzy/files/patch-src_DoublePinyinTable.h
Comment 9 commit-hook freebsd_committer freebsd_triage 2019-09-12 17:16:19 UTC
A commit references this bug:

Author: pkubaj
Date: Thu Sep 12 17:16:10 UTC 2019
New revision: 511889
URL: https://svnweb.freebsd.org/changeset/ports/511889

Log:
  chinese/pyzy: commit forgotten parts of PR 240457

  PR:		240457
  Approved by:	linimon (mentor), henry.hu.sh@gmail.com (maintainer)

Changes:
  head/chinese/pyzy/Makefile