[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#8254: race condition in dired.c's scmp function
From: |
Paul Eggert |
Subject: |
bug#8254: race condition in dired.c's scmp function |
Date: |
Tue, 15 Mar 2011 00:31:51 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 |
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.
bug#8254: race condition in dired.c's scmp function, Paul Eggert, 2011/03/17