Discussion:
[PATCH] fnmatch: fix typo introduced on 2016-08-17
(too old to reply)
Paul Eggert
2016-11-26 02:47:31 UTC
Permalink
Raw Message
This fixes the port to non-GCC compilers that lack __builtin_expect.
* lib/fnmatch.c (__builtin_expect): Change A&&B to !A||B.
---
ChangeLog | 4 ++++
lib/fnmatch.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 2047998..26eb3d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2016-11-25 Paul Eggert <***@cs.ucla.edu>

+ fnmatch: fix typo introduced on 2016-08-17
+ This fixes the port to non-GCC compilers that lack __builtin_expect.
+ * lib/fnmatch.c (__builtin_expect): Change A&&B to !A||B.
+
dfa: simplify with new function fillset
* lib/dfa.c (fillset): New function.
Use it for clarity when applicable.
diff --git a/lib/fnmatch.c b/lib/fnmatch.c
index bd9e587..75b85c0 100644
--- a/lib/fnmatch.c
+++ b/lib/fnmatch.c
@@ -22,7 +22,7 @@
# define _GNU_SOURCE 1
#endif

-#if ! defined __builtin_expect && defined __GNUC__ && __GNUC__ < 3
+#if ! defined __builtin_expect && (!defined __GNUC__ || __GNUC__ < 3)
# define __builtin_expect(expr, expected) (expr)
#endif
--
2.7.4
Loading...