public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors Date: Mon, 16 Apr 2012 11:41:00 -0000 [thread overview] Message-ID: <bug-53001-4-kQ05quhJZy@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-53001-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001 Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-16 11:41:24 UTC --- (In reply to comment #0) > 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: Should it also warn for non-literals? int foo(double x) { return x; } > 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. Yes, I think it should be easy to implement. You will also need to add a new option to gcc/c.opt and enable -Wfloat-conversion with -Wconversion (grep for OPT_Wimplict and how it handles its suboptions). Unfortunately, I don't have time to work on this, and probably nobody else has, so you could try to submit a patch: http://gcc.gnu.org/contribute.html
next prev parent reply other threads:[~2012-04-16 11:41 UTC|newest] Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-04-16 3:16 [Bug c/53001] New: " jjcogliati-r1 at yahoo dot com 2012-04-16 11:41 ` manu at gcc dot gnu.org [this message] 2012-04-16 12:17 ` [Bug c/53001] " 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-53001-4-kQ05quhJZy@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).