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]
It also probably fixes build on ARM architectures. .if ${CHOSEN_COMPILER_TYPE} == gcc CXXFLAGS+= -Wno-error=narrowing .endif can now probably be removed.
Created attachment 207337 [details] v2 I have verified this also fixes build on ARM.
Approved as mentor (builds on ppcports).
^Triage: Reporter is committer, assign accordingly
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.
(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.
(In reply to Piotr Kubaj from comment #6) It's unsigned on arm*, see arch(7) Endianness and Char Signedness
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
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