[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#8254: race condition in dired.c's scmp function
From: |
Juanma Barranquero |
Subject: |
bug#8254: race condition in dired.c's scmp function |
Date: |
Tue, 15 Mar 2011 12:36:45 +0100 |
On Tue, Mar 15, 2011 at 08:31, Paul Eggert <eggert@cs.ucla.edu> wrote:
> Generally speaking,
> code is easier to read and contains fewer errors
> when function-like macros act like functions.
That's true, but then there's adding complexity when it is not needed.
In this case, it is hard to know whether it is needed or not. On one
hand, the only suspicious use of DOWNCASE is the one you pointed out.
On the other hand, DOWNCASE begat UPPERCASEP, who begat LOWERCASEP and
UPCASE (and also ISUPPER in regex.c). Not to mention UPCASE1, which
uses the same variables and begat UPCASE (with LOWERCASEP) and
NOCASEP... Though most of these cases use ?: and && and not ==, it is
certainly tedious to check every instance of these macros.
A (perhaps stupid) idea: would it be possible to define
-DENABLE-CHECKING alternate versions of DOWNCASE and UPCASE1 which do
some additional checking for side effects? That would allow finding
the possible bugs during development.
Juanma
bug#8254: race condition in dired.c's scmp function, Paul Eggert, 2011/03/17