[all-commits] [llvm/llvm-project] 51d7f6: Don't emit pointer to int cast warnings under -Wmi...

aeubanks via All-commits all-commits at lists.llvm.org
Mon Mar 9 13:27:57 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 51d7f645448b49c7d3b029a60532bac019da1348
      https://github.com/llvm/llvm-project/commit/51d7f645448b49c7d3b029a60532bac019da1348
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   2020-03-09 (Mon, 09 Mar 2020)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaCast.cpp
    M clang/test/Sema/MicrosoftExtensions.c

  Log Message:
  -----------
  Don't emit pointer to int cast warnings under -Wmicrosoft-cast

Summary:
MSVC also warns on this:
$ cat /tmp/a.c
int f(void* p) { return (int) p; }

$ cl /c /tmp/a.c
C:/src/tmp/a.c(1): warning C4311: 'type cast': pointer truncation from
'void *' to 'int'

Warnings originally added in https://reviews.llvm.org/D72231.

Subscribers: cfe-commits

Tags: #clang

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




More information about the All-commits mailing list