PR# 18038 C compiler warning about out of range conversion to float for smallest positive REAL_32
Problem Report Summary
Submitter: prestoat2000
Category: Compiler
Priority: Low
Date: 2011/12/06
Class: Bug
Severity: Non-critical
Number: 18038
Release: 7.0.88074
Confidential: No
Status: Open
Responsible:
Environment: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9.0.10) Gecko/2009042715 Firefox/3.0.10
Solaris 10 on x86
Synopsis: C compiler warning about out of range conversion to float for smallest positive REAL_32
Description
When I finalize with the attached class, the C compiler issues a warning: "te848.c", line 47: warning: conversion to float is out of range The class assigns the smallest positive REAL_32 value (1.17549e-38) to a REAL_32 local. This test case was derived from code generated by AutoTest. Here is the generated final C code: RTHOOK(1); loc1 = (EIF_REAL_32) (EIF_REAL_32) 1.17549e-38; RTHOOK(2); tr1 = RTLNS(741, 741, _OBJSIZ_0_1_0_0_0_0_0_0_); *(EIF_BOOLEAN *)tr1 = (EIF_BOOLEAN)(loc1 == 1.1754899999999999e-38f); The warning occurs because the first constant should be 1.17549e-38f (to specify it as a float). Ideally, both constants should be 1.17549e-38f but this would require preserving the actual text of the constant from the source code. Code execution seems to work correctly.
To Reproduce
Finalize with attached class.