[all-commits] [llvm/llvm-project] 14aaf4: [Sema] Split off warn_impcast_integer_float_precis...

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Apr 23 18:33:28 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 14aaf4457c641bd5130072ba2a035e254b92fad3
      https://github.com/llvm/llvm-project/commit/14aaf4457c641bd5130072ba2a035e254b92fad3
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-04-23 (Thu, 23 Apr 2020)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/test/Sema/implicit-int-float-conversion.c

  Log Message:
  -----------
  [Sema] Split off warn_impcast_integer_float_precision_constant into -Wimplicit-const-int-float-conversion

Currently, both `warn_impcast_integer_float_precision_constant` and
`warn_impcast_integer_float_precision` are covered by
-Wimplicit-int-float-conversion, but only the ..._constant warning is on
by default.

`warn_impcast_integer_float_precision_constant` likely flags real problems
while `warn_impcast_integer_float_precision` may flag legitimate use
cases (for example, `int` used with limited range supported by `float`).

If -Wno-implicit-int-float-conversion is used, currently there is no way
to restore the ..._constant warning. This patch adds
-Wimplicit-const-int-float-conversion to address the issue. (Similar to
the reasoning in https://reviews.llvm.org/D64666#1598194)

Adapted from a patch by Brooks Moses.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D78661




More information about the All-commits mailing list