From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Revision 103880 broke the Windows build Date: Sun, 10 Apr 2011 12:53:50 -0700 Organization: UCLA Computer Science Department Message-ID: <4DA20ACE.4070303@cs.ucla.edu> References: <83ei5armws.fsf@gnu.org> <4DA1F6F3.2050604@cs.ucla.edu> <83bp0erkw7.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1302465254 22027 80.91.229.12 (10 Apr 2011 19:54:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 10 Apr 2011 19:54:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 10 21:54:10 2011 Return-path: Envelope-to: ged-emacs-devel@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 1Q90hz-0004px-S2 for ged-emacs-devel@m.gmane.org; Sun, 10 Apr 2011 21:54:08 +0200 Original-Received: from localhost ([127.0.0.1]:42568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q90hz-0000JC-Dv for ged-emacs-devel@m.gmane.org; Sun, 10 Apr 2011 15:54:07 -0400 Original-Received: from [140.186.70.92] (port=52813 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q90hr-0000Fh-H4 for emacs-devel@gnu.org; Sun, 10 Apr 2011 15:54:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q90hq-0001tH-FH for emacs-devel@gnu.org; Sun, 10 Apr 2011 15:53:59 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:49922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q90hp-0001rl-2N; Sun, 10 Apr 2011 15:53:57 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 9161C39E80F5; Sun, 10 Apr 2011 12:53:55 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ySQqLeGaatW8; Sun, 10 Apr 2011 12:53:55 -0700 (PDT) Original-Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 38F9839E80DB; Sun, 10 Apr 2011 12:53:55 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9 In-Reply-To: <83bp0erkw7.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138364 Archived-At: On 04/10/2011 12:01 PM, Eli Zaretskii wrote: > You are reading MSDN for one of the latest versions of the runtime. > Not everyone has that installed Ah, OK, thanks. I committed the following, which uses memchr instead. Other w32 already uses memchr so memchr should be OK. A quick Google search says MacOS has it too. === modified file 'src/ChangeLog' --- src/ChangeLog 2011-04-10 19:12:28 +0000 +++ src/ChangeLog 2011-04-10 19:47:49 +0000 @@ -1,5 +1,7 @@ 2011-04-10 Paul Eggert + * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack. + Fix more problems found by GCC 4.6.0's static checks. * xdisp.c (vmessage): Use a better test for character truncation. === modified file 'src/xdisp.c' --- src/xdisp.c 2011-04-10 02:27:15 +0000 +++ src/xdisp.c 2011-04-10 19:47:49 +0000 @@ -8417,10 +8417,13 @@ /* Do any truncation at a character boundary. */ if (! (0 <= len && len < bufsize)) - for (len = strnlen (buf, bufsize); - len && ! CHAR_HEAD_P (buf[len - 1]); - len--) - continue; + { + char *end = memchr (buf, 0, bufsize); + for (len = end ? end - buf : bufsize; + len && ! CHAR_HEAD_P (buf[len - 1]); + len--) + continue; + } message2 (FRAME_MESSAGE_BUF (f), len, 0); }