Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Oct 2019 20:08:20 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r353590 - stable/12/lib/msun/src
Message-ID:  <201910152008.x9FK8KVI014535@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Tue Oct 15 20:08:19 2019
New Revision: 353590
URL: https://svnweb.freebsd.org/changeset/base/353590

Log:
  MFC r353329:
  
  msun: Silence new harmless -Wimplicit-int-float-conversion warnings
  
  Clang from trunk recently added a warning for when implicit int-to-float
  conversions cause a loss of precision. The code in question is designed
  to be able to handle that, so add explicit casts to silence this.
  
  Submitted by:	James Clarke <jrtc27@jrtc27.com>
  Reviewed by:	dim
  Obtained from:	CheriBSD
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D21913

Modified:
  stable/12/lib/msun/src/s_lround.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/msun/src/s_lround.c
==============================================================================
--- stable/12/lib/msun/src/s_lround.c	Tue Oct 15 20:04:15 2019	(r353589)
+++ stable/12/lib/msun/src/s_lround.c	Tue Oct 15 20:08:19 2019	(r353590)
@@ -49,9 +49,9 @@ __FBSDID("$FreeBSD$");
  * that everything is in range.  At compile time, INRANGE(x) should reduce to
  * two floating-point comparisons in the former case, or TRUE otherwise.
  */
-static const type dtype_min = DTYPE_MIN - 0.5;
-static const type dtype_max = DTYPE_MAX + 0.5;
-#define	INRANGE(x)	(dtype_max - DTYPE_MAX != 0.5 || \
+static const type dtype_min = (type)DTYPE_MIN - 0.5;
+static const type dtype_max = (type)DTYPE_MAX + 0.5;
+#define	INRANGE(x)	(dtype_max - (type)DTYPE_MAX != 0.5 || \
 			 ((x) > dtype_min && (x) < dtype_max))
 
 dtype



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910152008.x9FK8KVI014535>