[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 4 14:14:47 PDT 2025


5chmidti wrote:

> > Have you looked at google-runtime-int? It should be doing the same thing (maybe small differences)
> 
> I haven't before now. I still think a new check is necessary. 
> 
> `google-runtime-int` isn't as strict because it is coupled to the Google coding guidelines. That means it doesn't flag `int`, `float`, `double`, etc. That behaviour shouldn't change as Google's coding guidelines explicitly recommend using `int` for loop counters as well as `float`, `double` for IEEE754 floats. 
> 
> This check will encompass usage of almost all fundamental types that are implementation-defined, including `float`, `double`, `int`, and (potentially) `char`. The main exception is `bool` because it doesn't suffer from the same overflow issues as other types. This is a significant change and goes against Google's coding guidelines. 

I was on mobile, so I couldn't compare them exhaustively, thanks for the run down.

I'll do an actual review on the weekend

https://github.com/llvm/llvm-project/pull/146970


More information about the cfe-commits mailing list