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.
Differential D75643
[Sema] Don't emit pointer to int cast warnings under -Wmicrosoft-cast aeubanks on Mar 4 2020, 1:34 PM. Authored by
Details MSVC also warns on this: $ cl /c /tmp/a.c Warnings originally added in https://reviews.llvm.org/D72231.
Diff Detail
Event TimelineComment Actions Looking at the review, I think @rsmith requested this -Wmicrosoft-cast behavior here: This change looks good to me, but I wanted to get his input before we undo his request. Comment Actions I re-read Richard's comment:
My interpretation is that he was suggesting the change that you are making here. So, let's continue without his additional approval. I'll go ahead and push this in a minute. Comment Actions I think I patched this in, ran tests, but didn't push. Feel free to push if you get the chance. |