Opened 7 weeks ago

Last modified 6 weeks ago

#22801 needs_review defect

Warnings from isnan, isinfinite, signbit on mingw

Reported by: nickm Owned by: nickm
Priority: Medium Milestone: Tor: 0.2.8.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: 028-backport, 029-backport, 030-backport, 031-backport
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

We're seeing these on jenkins. They're somewhat annoying. I have a fix. Making this ticket for tracking purposes.

11:32:49 In file included from src/common/util.c:44:0:
11:32:49 src/common/util.c: In function 'clamp_double_to_int64':
11:32:49 src/common/util.c:5602:13: error: conversion to 'float' from 'double' may alter its value [-Werror=float-conversion]
11:32:49    if (isnan(number)) {
11:32:49              ^
11:32:49 src/common/util.c:5620:16: error: conversion to 'float' from 'double' may alter its value [-Werror=float-conversion]
11:32:49    if (isfinite(number) && exponent <= 63) {
11:32:49                 ^
11:32:49 src/common/util.c:5625:18: error: conversion to 'float' from 'double' may alter its value [-Werror=float-conversion]
11:32:49    return signbit(number) ? INT64_MIN : INT64_MAX;
11:32:49                   ^
11:32:50 cc1: all warnings being treated as errors

Child Tickets

Change History (7)

comment:1 Changed 7 weeks ago by nickm

Owner: set to nickm
Status: newaccepted

comment:2 Changed 7 weeks ago by nickm

'Fix' in my branch bug22801_028

comment:3 Changed 7 weeks ago by nickm

Status: acceptedneeds_review

comment:4 Changed 7 weeks ago by yawning

lgtm

comment:5 Changed 6 weeks ago by nickm

Keywords: review-group-20 added

Creating review-group-20

comment:6 Changed 6 weeks ago by nickm

Keywords: review-group-20 removed
Milestone: Tor: 0.3.2.x-finalTor: 0.2.8.x-final

Merged to 0.2.9 and forwards. Marking for 0.2.8 backport; recommending "no".

comment:7 Changed 6 weeks ago by nickm

This required a fix for mingw versions that don't have -Wfloat-conversion: see dfc06148407a16

Note: See TracTickets for help on using tickets.