From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#8435: misuse of error ("...%d...", ...) on 64-bit hosts Date: Thu, 07 Apr 2011 21:31:55 +0300 Message-ID: <8339ltvrok.fsf@gnu.org> References: <4D9CC60D.2090301@cs.ucla.edu> <4D9D68D8.6060200@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1302201493 7170 80.91.229.12 (7 Apr 2011 18:38:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Apr 2011 18:38:13 +0000 (UTC) Cc: 8435@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 07 20:38:06 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7u5h-0002pn-VD for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Apr 2011 20:38:02 +0200 Original-Received: from localhost ([127.0.0.1]:40073 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7u5h-0000wo-28 for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Apr 2011 14:38:01 -0400 Original-Received: from [140.186.70.92] (port=54109 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7u53-0000YP-1C for bug-gnu-emacs@gnu.org; Thu, 07 Apr 2011 14:37:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7u52-0000BE-2n for bug-gnu-emacs@gnu.org; Thu, 07 Apr 2011 14:37:20 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7u51-0000B6-W6 for bug-gnu-emacs@gnu.org; Thu, 07 Apr 2011 14:37:20 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Q7u2n-0006Em-Jk; Thu, 07 Apr 2011 14:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Apr 2011 18:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8435 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8435-submit@debbugs.gnu.org id=B8435.130220124823915 (code B ref 8435); Thu, 07 Apr 2011 18:35:01 +0000 Original-Received: (at 8435) by debbugs.gnu.org; 7 Apr 2011 18:34:08 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7u1w-0006Df-7P for submit@debbugs.gnu.org; Thu, 07 Apr 2011 14:34:08 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7u1s-0006D9-Vj for 8435@debbugs.gnu.org; Thu, 07 Apr 2011 14:34:06 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LJA00300OC28O00@a-mtaout23.012.net.il> for 8435@debbugs.gnu.org; Thu, 07 Apr 2011 21:33:59 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.229.239.68]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LJA002KWOWLYZD0@a-mtaout23.012.net.il>; Thu, 07 Apr 2011 21:33:59 +0300 (IDT) In-reply-to: <4D9D68D8.6060200@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 07 Apr 2011 14:35:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45681 Archived-At: > Date: Thu, 07 Apr 2011 00:33:44 -0700 > From: Paul Eggert > > This patch assumes that vsnprintf works. Bother: using `vsnprintf' here could cause problems when `error' is used to format messages with non-ASCII characters. `doprnt' was careful in these cases, e.g., it would take care of truncating multibyte strings only on character boundaries. It also supported %c format for converting a multibyte character to its integer representation. Can we trust `vsnprintf' to not misbehave in these cases, and DTRT with the entire repertory of characters supported by Emacs? There's also an issue with old pre-C99 implementations of `vsnprintf' which returned -1 when the buffer was too small. However, I think catering for those would be a trivial change in `verror', so that's not a big deal. > I assume that vsnprintf works on Windows, so the presence or absence > of the vsnprintf module shouldn't matter for Windows. Yes, the MinGW build will have no problem. The MSVC build will need the above-mentioned change in `verror', because the Microsoft runtime's version of `vsnprintf' is not compatible with ISO C99. But that can be fixed later, if needed.