[Bug c/63886] float will fit into int with abs - possible missing warning Wabsolute-value

dcb314 at hotmail dot com gcc-bugzilla@gcc.gnu.org
Sat Nov 15 14:15:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63886

--- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to David Binderman from comment #2)
> Given the obscurity of -Wfloat-conversion, maybe it is time for it 
> to be included in -Wall, where more folks will notice it ?

Scratch that. While -Wfloat-conversion does check fine for
int into double, it also does the "whole lot less useful, even
though technically accurate" double into float message.

Like

float f = 3.1;

warning: conversion to ‘float’ alters ‘double’ constant value
[-Wfloat-conversion]

I'll proceed with -Wfloat-conversion, but I'll be stripping out
(fgrep -v) these unwanted warnings.


More information about the Gcc-bugs mailing list