From patchwork Fri Dec 19 13:34:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 4362 Received: (qmail 10289 invoked by alias); 19 Dec 2014 13:40:35 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 14703 invoked by uid 89); 19 Dec 2014 13:34:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yh0-f51.google.com X-Received: by 10.170.83.135 with SMTP id z129mr7045123ykz.3.1418996085177; Fri, 19 Dec 2014 05:34:45 -0800 (PST) Date: Fri, 19 Dec 2014 05:34:43 -0800 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] Replace 1L with (mp_limb_t) 1 Message-ID: <20141219133443.GA4881@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X86-64 and x32 use sysdeps/i386/ldbl2mpn.c. res_ptr is a pointer to mp_limb_t, which is long for i386 and x86-64 and long long for x32. On x32, I got ../sysdeps/x86_64/../i386/ldbl2mpn.c: In function ‘__mpn_extract_long_double’: ../sysdeps/x86_64/../i386/ldbl2mpn.c:72:4: error: left shift count >= width of type [-Werror] res_ptr[N - 1] &= ~(1L << ((LDBL_MANT_DIG - 1) % BITS_PER_MP_LIMB)); ^ cc1: all warnings being treated as errors This patch replaces 1L with (mp_limb_t) 1. Verified on x32, i686 and x86-64 with GCC 4.8.3. I checked it in as an obvious fix. H.J. --- ChangeLog | 5 +++++ sysdeps/i386/ldbl2mpn.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 799b21a..eda51f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-12-19 H.J. Lu + + * sysdeps/i386/ldbl2mpn.c (__mpn_extract_long_double): Replace + 1L with (mp_limb_t) 1. + 2014-12-17 Roland McGrath * sysdeps/nptl/fork.c (__fork_generation_pointer): Variable moved ... diff --git a/sysdeps/i386/ldbl2mpn.c b/sysdeps/i386/ldbl2mpn.c index 09e3096..6f92833 100644 --- a/sysdeps/i386/ldbl2mpn.c +++ b/sysdeps/i386/ldbl2mpn.c @@ -69,7 +69,7 @@ __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size, for denormalized number. If it is one, the number is according to Intel's specification an invalid number. We make the representation unique by explicitly clearing this bit. */ - res_ptr[N - 1] &= ~(1L << ((LDBL_MANT_DIG - 1) % BITS_PER_MP_LIMB)); + res_ptr[N - 1] &= ~((mp_limb_t) 1 << ((LDBL_MANT_DIG - 1) % BITS_PER_MP_LIMB)); if (res_ptr[N - 1] != 0) {