[PATCH] D64666: [Sema] Enable -Wimplicit-float-conversion for integral to floating point precision loss

Ziang Wan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 24 10:14:53 PDT 2019


ziangwan added a comment.

In D64666#1598194 <https://reviews.llvm.org/D64666#1598194>, @jfb wrote:

> Thanks, the update looks good.
>
> One thing I just noticed: if I have a codebase with `-Wimplicit-float-conversion` it seems like updating clang will automatically turn the two new warnings on, correct? That seems good, but also difficult to roll out because I can't turns off just the two new warnings. In other words, if I want to adopt a new clang and I had `-Wimplicit-float-conversion` then the only options I have are: fix all the new warnings (which might take time given how much code I have), or turn off *all* of `-Wimplicit-float-conversion`. I think it makes sense to force fixing all warnings for the warning that's always a problem `warn_impcast_integer_float_precision_constant`, but for `warn_impcast_integer_float_precision` it would be nice if there were a `-Wno-*` which disables only `warn_impcast_integer_float_precision` and nothing else.
>  This would make it way easier to roll out a new clang.


Yes, you are right. I am thinking about making a new flag for the warning but make "definitely lose" one default on. How about `-Wimplicit-int-float-conversion`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64666/new/

https://reviews.llvm.org/D64666





More information about the cfe-commits mailing list