Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Dec 2016 14:08:35 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        David Chisnall <theraven@freebsd.org>,  Baptiste Daroussin <bapt@freebsd.org>, "Conrad E. Meyer" <cem@freebsd.org>,  src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r310138 - head/lib/libc/stdio
Message-ID:  <20161218134740.L955@besplex.bde.org>
In-Reply-To: <0BDD9ECA-AF91-4CA7-AA5D-DC7AD36AE531@FreeBSD.org>
References:  <201612160144.uBG1ipjW016736@repo.freebsd.org> <20161216193128.wgskqt4vc44vdd7o@ivaldir.etoilebsd.net> <00BFA847-B26A-453A-87DB-D5A55C1FAA38@FreeBSD.org> <0BDD9ECA-AF91-4CA7-AA5D-DC7AD36AE531@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 17 Dec 2016, Dimitry Andric wrote:

> On 17 Dec 2016, at 12:46, David Chisnall <theraven@FreeBSD.org> wrote:
>>
>> On 16 Dec 2016, at 19:31, Baptiste Daroussin <bapt@FreeBSD.org> wrote:
>>>
>>> Other than that, it makes more difficult to use vanilla gcc with out us=
erland.
>>> and it is adding more complexity to be able to build freebsd from a non=
 freebsd
>>> system which some people are working on.
>>
>> Why?  You=E2=80=99ll get some spurious warnings about printf, but that=
=E2=80=99s all.
>
> Unfortunately, we compile large parts of the tree with -Werror.  Thus,
> "spurious warnings" will break the build, leaving the user two options:
> disabling -Wformat warnings, or disabling -Werror altogether, neither of
> which are very recommendable.
>
> As far as I know, there is no -Wno-error-on-undefined-printf-specifiers.
> It would also be hard to implement, since after any undefined specifiers
> have been encountered, you cannot reason about the following ones
> anymore either.
>
> IMHO, if people want to use non-standard specifiers, let them define
> their own almost_printf_but_not_quite() functions, and forgo any format
> checking.

That would be worse than breaking format checking for the selected set
of printf()s.  It gives even more unportability.  %b is a BSDism that
would be detected at compile time on systems without support for %b in
printf().  almost_printf_but_not_quite() is a FreeBSDism that would
be detected at compile time on systems without the function.  Using
it breaks portability even to other BSD systems including previous
versions of FreeBSD.

People who want to use non-standard specifiers added support to check
them the compiler.

Bruce
From owner-svn-src-all@freebsd.org  Sun Dec 18 04:11:14 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36E82C8644C;
 Sun, 18 Dec 2016 04:11:14 +0000 (UTC)
 (envelope-from bapt@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 11A9AC8E;
 Sun, 18 Dec 2016 04:11:13 +0000 (UTC)
 (envelope-from bapt@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBI4BDng057417;
 Sun, 18 Dec 2016 04:11:13 GMT (envelope-from bapt@FreeBSD.org)
Received: (from bapt@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBI4BDML057416;
 Sun, 18 Dec 2016 04:11:13 GMT (envelope-from bapt@FreeBSD.org)
Message-Id: <201612180411.uBI4BDML057416@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bapt set sender to
 bapt@FreeBSD.org using -f
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Sun, 18 Dec 2016 04:11:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r310199 - head/tools/tools/locale/tools
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>;
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 18 Dec 2016 04:11:14 -0000

Author: bapt
Date: Sun Dec 18 04:11:13 2016
New Revision: 310199
URL: https://svnweb.freebsd.org/changeset/base/310199

Log:
  Better handle posix names for locales

Modified:
  head/tools/tools/locale/tools/finalize

Modified: head/tools/tools/locale/tools/finalize
==============================================================================
--- head/tools/tools/locale/tools/finalize	Sun Dec 18 02:02:33 2016	(r310198)
+++ head/tools/tools/locale/tools/finalize	Sun Dec 18 04:11:13 2016	(r310199)
@@ -41,20 +41,29 @@ AWKCMD="/## PLACEHOLDER/ { \
 
 # Rename the sources with 3 components name into the POSIX version of the name using @modifier
 cd $old
+pwd
 for i in *_*_*.*.src; do
+	if [ "$i" = "*_*_*.*.src" ]; then
+		break
+	fi
 	oldname=${i%.*}
 	nname=`echo $oldname | awk '{ split($0, a, "_"); print a[1]"_"a[3]"@"a[2];} '`
-	mv -i ${oldname}.src ${nname}.src
+	mv -f ${oldname}.src ${nname}.src
+	sed -i '' -e "s/${oldname}/${nname}/g" Makefile
+	COLLATIONS_SPECIAL=$(echo ${COLLATIONS_SPECIAL} | sed -e "s/${oldname}/${nname}/g")
 done
-	sed -i '' -Ee "s/([a-zA-Z]{2})_([a-zA-Z]+)_([a-zA-Z]{2}).([a-zA-Z0-9-]+)/\1_\3.\4@\2/g" ${old}/Makefile
 
 # For variable without @modifier ambiguity do not keep the @modifier
 for i in *@*.src; do
+	if [ "$i" = "*@*.src" ]; then
+		break
+	fi
 	oldname=${i%.*}
 	shortname=${oldname%@*}
-	if [ $(ls ${shortname}@* | wc -l) -eq 1 -a ! -f ${shortname}.src ] ; then
-		mv -i $i ${shortname}.src
-		sed -i '' -e "s/${oldname}/${shortname}/g" ${old}/Makefile
+	if [ $(ls ${shortname}@* | wc -l) -eq 1 ] ; then
+		mv -f $i ${shortname}.src
+		sed -i '' -e "s/${oldname}/${shortname}/g" Makefile
+		COLLATIONS_SPECIAL=$(echo ${COLLATIONS_SPECIAL} | sed -e "s/${oldname}/${shortname}/g")
 	fi
 done
 
@@ -63,16 +72,19 @@ for i in *@Latn.src; do
 	if [ "$i" = "*@Latn.src" ]; then
 		break
 	fi
-	mv ${i} ${i%@*}@latin.src
+	mv -f ${i} ${i%@*}@latin.src
+	sed -i '' -e "s/${i%.*}/${i%@*}@latin/g" Makefile
+	COLLATIONS_SPECIAL=$(echo ${COLLATIONS_SPECIAL} | sed -e "s/${i%.*}/${i%@*}@latin/g")
 done
-	sed -i '' -e "s/@Latn/@latin/g" ${old}/Makefile
+
 for i in *@Cyrl.src; do
 	if [ "$i" = "*@Cyrl.src" ]; then
 		break
 	fi
-	mv ${i} ${i%@*}@cyrillic.src
+	mv -f ${i} ${i%@*}@cyrillic.src
+	sed -i '' -e "s/${i%.*}/${i%@*}@cyrillic/g" Makefile
+	COLLATIONS_SPECIAL=$(echo ${COLLATIONS_SPECIAL} | sed -e "s/${i%.*}/${i%@*}@cyrillic/g")
 done
-	sed -i '' -e "s/@Cyrl/@cyrillic/g" ${old}/Makefile
 
 # On locales with multiple modifiers rename the "default" version without the @modifier
 default_locales="sr_RS@cyrillic"
@@ -83,8 +95,8 @@ for i in ${default_locales}; do
 		if [ "$l" = "${localename}.*@${mod}.src" ]; then
 			break
 		fi
-		mv ${l} ${l%@*}.src
-		sed -i '' -e "s/${l%.*}/${l%@*}/g" ${old}/Makefile
+		mv -f ${l} ${l%@*}.src
+		sed -i '' -e "s/${l%.*}/${l%@*}/g" Makefile
 	done
 done
 cd -
@@ -146,13 +158,12 @@ then
 	done
 	echo "" >> ${TEMP4}
 	for enc in ${COLLATIONS_SPECIAL}; do
-		nname=`echo $enc | sed -e 's/_Hans//g'`
-		sed -i '' "/^.*${nname}$/d" ${TEMP4}
-		echo "LOCALES+=	${nname}" >> ${TEMP4}
+		sed -i '' "/^.*${enc}$/d" ${TEMP4}
+		echo "LOCALES+=	${enc}" >> ${TEMP4}
 	done
 
 	keep=$(cat ${TEMP} | awk '{ print $2 }')
-	for original in ${keep}
+	for original in ${keep} ${COLLATIONS_SPECIAL}
 	do
 		cp ${old}/${original}.src ${new}/
 	done



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161218134740.L955>