summaryrefslogtreecommitdiff
path: root/src/ccl.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-06-15 12:40:52 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-06-15 12:40:52 -0700
commitb1c46f026de9d185ba86ffb1b23c50f2bd095ccf (patch)
tree9f14768fa2b513e63a69102eb7514a129db872e5 /src/ccl.c
parent096a9774c8a8c8710f07e2fbab54e35efeb38050 (diff)
downloademacs-b1c46f026de9d185ba86ffb1b23c50f2bd095ccf.tar.gz
emacs-b1c46f026de9d185ba86ffb1b23c50f2bd095ccf.tar.bz2
emacs-b1c46f026de9d185ba86ffb1b23c50f2bd095ccf.zip
* ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
(GET_CCL_RANGE, IN_INT_RANGE): Use it.
Diffstat (limited to 'src/ccl.c')
-rw-r--r--src/ccl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ccl.c b/src/ccl.c
index e2ef4f194f3..30d151f00a0 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -745,11 +745,15 @@ while(0)
#endif
+/* Use "&" rather than "&&" to suppress a bogus GCC warning; see
+ <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43772>. */
+#define ASCENDING_ORDER(lo, med, hi) (((lo) <= (med)) & ((med) <= (hi)))
+
#define GET_CCL_RANGE(var, ccl_prog, ic, lo, hi) \
do \
{ \
EMACS_INT prog_word = XINT ((ccl_prog)[ic]); \
- if (! ((lo) <= prog_word && prog_word <= (hi))) \
+ if (! ASCENDING_ORDER (lo, prog_word, hi)) \
CCL_INVALID_CMD; \
(var) = prog_word; \
} \
@@ -761,7 +765,7 @@ while(0)
#define GET_CCL_INT(var, ccl_prog, ic) \
GET_CCL_RANGE (var, ccl_prog, ic, INT_MIN, INT_MAX)
-#define IN_INT_RANGE(val) (INT_MIN <= (val) && (val) <= INT_MAX)
+#define IN_INT_RANGE(val) ASCENDING_ORDER (INT_MIN, val, INT_MAX)
/* Encode one character CH to multibyte form and write to the current
output buffer. If CH is less than 256, CH is written as is. */