GNU bug report logs -
#8254
race condition in dired.c's scmp function
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Tue, 15 Mar 2011 06:17:02 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Date: Tue, 15 Mar 2011 00:31:51 -0700
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: 8254 <at> 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.
This bug report was last modified 14 years and 72 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.