From owner-dev-commits-ports-main@freebsd.org Sat Oct 2 11:23:17 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C6DE679E1A; Sat, 2 Oct 2021 11:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HM4NP0bw3z3kcw; Sat, 2 Oct 2021 11:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE43512716; Sat, 2 Oct 2021 11:23:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 192BNGcW084193; Sat, 2 Oct 2021 11:23:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 192BNGM1084192; Sat, 2 Oct 2021 11:23:16 GMT (envelope-from git) Date: Sat, 2 Oct 2021 11:23:16 GMT Message-Id: <202110021123.192BNGM1084192@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dimitry Andric Subject: git: 0efce95397d4 - main - chinese/c2t: fix "error: address of register variable requested" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0efce95397d4b53be14448a803902191ab8c1df3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 11:23:17 -0000 The branch main has been updated by dim (src committer): URL: https://cgit.FreeBSD.org/ports/commit/?id=0efce95397d4b53be14448a803902191ab8c1df3 commit 0efce95397d4b53be14448a803902191ab8c1df3 Author: Dimitry Andric AuthorDate: 2021-09-12 20:48:25 +0000 Commit: Dimitry Andric CommitDate: 2021-10-02 11:19:56 +0000 chinese/c2t: fix "error: address of register variable requested" During an exp-run for llvm 13 (see bug 258209), it turned out that chinese/c2t fails to build with clang 13: cc -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DCHINDICT=\"/usr/local/share/chinese/gb/TONEPY.tit\" -c c2t.c c2t.c:99:3: error: address of register variable requested hz[2] = '\0'; ^~ c2t.c:107:7: error: address of register variable requested hz[0] = (char)eka; ^~ c2t.c:108:7: error: address of register variable requested hz[1] = (char)toka; ^~ c2t.c:113:8: error: address of register variable requested if (hz[0] != (*pipo)[i] || hz[1] != (*pipo)[i+1]) continue; ^~ c2t.c:113:31: error: address of register variable requested if (hz[0] != (*pipo)[i] || hz[1] != (*pipo)[i+1]) continue; ^~ c2t.c:133:36: error: address of register variable requested fprintf(miss_chars, "%c", hz[0]); ^~ c2t.c:134:30: error: address of register variable requested fprintf(miss_chars, "%c ", hz[1]); ^~ c2t.c:143:17: error: address of register variable requested printf("%c", hz[0]); ^~ c2t.c:144:18: error: address of register variable requested printf("%c ", hz[1]); ^~ 9 errors generated. As indicated, arrays shouldn't be register variables as they don't have addresses. In general, the register keyword is deprecated and should no longer be used. To fix this, use a command line flag to define "register" to empty. PR: 258465 Approved by: maintainer timeout (2 weeks) MFH: 2021Q4 --- chinese/c2t/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chinese/c2t/Makefile b/chinese/c2t/Makefile index f39b83ce7475..fc3e01b36cc8 100644 --- a/chinese/c2t/Makefile +++ b/chinese/c2t/Makefile @@ -13,6 +13,8 @@ COMMENT= Translates GB/Big5 encoding to tone pinyin NO_WRKSUBDIR= yes EXTRACT_ONLY= c2t.tar.gz +CFLAGS+= -Dregister= + do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/share/chinese/gb ${INSTALL_PROGRAM} ${WRKSRC}/c2t ${STAGEDIR}${PREFIX}/bin