[PATCH] D33826: [clang-tidy] avoid pointer cast to more strict alignment check

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 12 08:30:43 PDT 2017


aaron.ballman added a comment.

In https://reviews.llvm.org/D33826#867155, @rjmccall wrote:

> In https://reviews.llvm.org/D33826#866170, @lebedev.ri wrote:
>
> > In https://reviews.llvm.org/D33826#866161, @JonasToth wrote:
> >
> > > There is an exception to the general rule (EXP36-C-EX2), stating that the result of `malloc` and friends is allowed to be casted to stricter alignments, since the pointer is known to be of correct alignment.
> >
>
>
> In practice, are there any malloc declarations still in use that return char* instead of void*?  I assume this does not complain when the source is void*.


FWIW, I've not found any malloc declarations that return `char *` instead of `void *`, but if someone knows of one, I'd be curious to hear of it.


Repository:
  rL LLVM

https://reviews.llvm.org/D33826





More information about the cfe-commits mailing list