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#8254: race condition in dired.c's scmp function Date: Tue, 15 Mar 2011 06:50:43 -0400 Message-ID: References: <4D7F043A.5070702@cs.ucla.edu> <4D7F15E7.1020407@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1300187236 2477 80.91.229.12 (15 Mar 2011 11:07:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 15 Mar 2011 11:07:16 +0000 (UTC) Cc: 8254@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 15 12:07:10 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 1PzS5l-00053Q-L5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Mar 2011 12:07:09 +0100 Original-Received: from localhost ([127.0.0.1]:41268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzS5k-0006TZ-Ri for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Mar 2011 07:07:08 -0400 Original-Received: from [140.186.70.92] (port=40828 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzS5e-0006PT-OG for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2011 07:07:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzS5c-0000Bg-OL for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2011 07:07:02 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzS5c-0000BZ-Mz for bug-gnu-emacs@gnu.org; Tue, 15 Mar 2011 07:07:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PzRqA-0005Xr-H5; Tue, 15 Mar 2011 06:51:02 -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: Tue, 15 Mar 2011 10:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8254 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8254-submit@debbugs.gnu.org id=B8254.130018625121298 (code B ref 8254); Tue, 15 Mar 2011 10:51:02 +0000 Original-Received: (at 8254) by debbugs.gnu.org; 15 Mar 2011 10:50:51 +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 1PzRpy-0005XT-Pl for submit@debbugs.gnu.org; Tue, 15 Mar 2011 06:50:50 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PzRpw-0005XG-Ey for 8254@debbugs.gnu.org; Tue, 15 Mar 2011 06:50:49 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1PzRpr-0008QC-4m; Tue, 15 Mar 2011 06:50:43 -0400 In-reply-to: <4D7F15E7.1020407@cs.ucla.edu> (message from Paul Eggert on Tue, 15 Mar 2011 00:31:51 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 15 Mar 2011 06:51:02 -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:45019 Archived-At: > Date: Tue, 15 Mar 2011 00:31:51 -0700 > From: Paul Eggert > CC: 8254@debbugs.gnu.org > > On 03/15/2011 12:06 AM, Eli Zaretskii wrote: > > How about a much simpler fix: > > > > while (l > > && (c1 = DOWNCASE ((unsigned char) *s1++), > > c2 = DOWNCASE ((unsigned char) *s2++), > > c1 == c2)) > > l--; > > > > (with suitable declarations of c1 and c2)? Will that fix the > > undefined behavior? > > Yes. But surely it's better to fix the problem so that > usage of DOWNCASE is less error-prone. Generally speaking, > code is easier to read and contains fewer errors > when function-like macros act like functions. Maybe, but I wonder if there's a better solution even if we decide to make these macros functions: I don't like to have the same static function in every file that includes buffer.h, on platforms that don't support inline functions. Anyway, this is Stefan's and Chong's call. I just voiced my astonishment that such a simple problem needs such a jumbo change.