https://github.com/ojhunt requested changes to this pull request.
I think a better solution here would to be to pull the logic that is diagnosing the same mistake in the memory accessing functions into a separate reusable function - DiagnoseSuspiciousBufferSizeof or something (my naming skills are terrible). See the logic in Sema::CheckMemaccessArguments where we gate the diagnostics on warn_sizeof_pointer_expr_memaccess being enabled - that's what I think we should be investigating lifting into a separate function that can be used in other similarly behaving functions, either completely or partially. https://github.com/llvm/llvm-project/pull/170637 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
