public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors
@ 2012-04-16  3:16 jjcogliati-r1 at yahoo dot com
  2012-04-16 11:41 ` [Bug c/53001] " manu at gcc dot gnu.org
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2012-04-16  3:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

             Bug #: 53001
           Summary: -Wfloat-conversion should be available to warn about
                    floating point errors
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jjcogliati-r1@yahoo.com


This is a request to add a new warning that warns on the subset of -Wconversion
warnings that involve floating point numbers.  For example, with
-Wfloat-conversion this would cause a warning:

int main(int argc, char ** argv) {
  int i = 3.14;
  return i;
}

I think this could mostly be done by modifying gcc/c-family/c-common.c
unsafe_conversion_p to add the ability to only warn on conversions where
REAL_TYPE or REAL_CST are involved.  

The reason -Wconversion is not sufficient is that using it can cause hundreds
of warnings, almost all of which are integer size warnings (many of which are
in libraries (such as libMesh)).  I would like to be able to enable something
like -Wfloat-conversion that would catch errors involving floating point number
conversions, while ignoring the integer size conversions.


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2013-11-22 13:10 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
2012-04-16 11:41 ` [Bug c/53001] " manu at gcc dot gnu.org
2012-04-16 12:17 ` jjcogliati-r1 at yahoo dot com
2012-04-16 12:37 ` manu at gcc dot gnu.org
2012-06-07 14:04 ` manu at gcc dot gnu.org
2012-06-22 12:29 ` jjcogliati-r1 at yahoo dot com
2012-06-22 12:41 ` manu at gcc dot gnu.org
2013-09-02 19:50 ` jjcogliati-r1 at yahoo dot com
2013-09-20 16:27 ` jjcogliati-r1 at yahoo dot com
2013-09-20 16:30 ` jjcogliati-r1 at yahoo dot com
2013-09-20 16:39 ` gcc at richardneill dot org
2013-09-20 17:27 ` jjcogliati-r1 at yahoo dot com
2013-09-20 20:27 ` manu at gcc dot gnu.org
2013-09-21  0:25 ` jjcogliati-r1 at yahoo dot com
2013-09-22 23:02 ` jjcogliati-r1 at yahoo dot com
2013-09-26  3:32 ` jjcogliati-r1 at yahoo dot com
2013-09-26 11:50 ` manu at gcc dot gnu.org
2013-09-27 12:06 ` jjcogliati-r1 at yahoo dot com
2013-09-30 12:13 ` jjcogliati-r1 at yahoo dot com
2013-10-11  2:23 ` jjcogliati-r1 at yahoo dot com
2013-10-11  2:31 ` jjcogliati-r1 at yahoo dot com
2013-10-13 13:48 ` jjcogliati-r1 at yahoo dot com
2013-10-16  2:48 ` jjcogliati-r1 at yahoo dot com
2013-10-22  1:37 ` jjcogliati-r1 at yahoo dot com
2013-11-20  7:15 ` manu at gcc dot gnu.org
2013-11-20  7:42 ` manu at gcc dot gnu.org
2013-11-22 13:10 ` jjcogliati-r1 at yahoo dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).