>From 725d6c22f209c96d4ca263ccc173ae77ae7942cf Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 16 Feb 2018 13:06:49 -0800 Subject: [PATCH] Better workaround for GCC bug with -Wconversion * src/lisp.h (INTEGER_TO_CONS): Undo previous change. * src/pdumper.c (DEFINE_TOLISP_FUNC): Disable -Wconversion when INTEGER_TO_CONS is used, too. --- src/lisp.h | 6 +++--- src/pdumper.c | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lisp.h b/src/lisp.h index 45e8a0d791..6d4635f2a7 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3568,9 +3568,9 @@ extern Lisp_Object arithcompare (Lisp_Object num1, Lisp_Object num2, itself, or a cons of two or three integers, or if all else fails a float. I should not have side effects. */ #define INTEGER_TO_CONS(i) \ - (! FIXNUM_OVERFLOW_P ((i)) \ - ? make_number ((EMACS_INT) (i)) \ - : EXPR_SIGNED ((i)) ? intbig_to_lisp ((i)) : uintbig_to_lisp ((i))) + (! FIXNUM_OVERFLOW_P (i) \ + ? make_number (i) \ + : EXPR_SIGNED (i) ? intbig_to_lisp (i) : uintbig_to_lisp (i)) extern Lisp_Object intbig_to_lisp (intmax_t); extern Lisp_Object uintbig_to_lisp (uintmax_t); diff --git a/src/pdumper.c b/src/pdumper.c index a05b2c47ce..cc1847356d 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -691,7 +691,10 @@ dump_object_self_representing_p (Lisp_Object object) static Lisp_Object \ fn (type value) \ { \ - return INTEGER_TO_CONS (value); \ + ALLOW_IMPLICIT_CONVERSION; \ + Lisp_Object result = INTEGER_TO_CONS (value); \ + DISALLOW_IMPLICIT_CONVERSION; \ + return result; \ } DEFINE_FROMLISP_FUNC (intmax_t_from_lisp, intmax_t); -- 2.14.3