[c++规范]:Google Runtime Int
consider replacing ‘unsigned long long’ with ‘uint64’
最近在用clang-tidy检查代码规范时,报了一个Google-Runtime-Int的error:

查了一下资料,原因应该时clang-tidy的代码检查,应用了google-runtime-int规范,具体的规范链接在: Google RunTimeInt 。具体的想法:尽量不适用long、unsigned这类标识符,而是使用int64_t或者uint64_t这类的定义。
但是,由于我的代码必须使用unsigend long long类型,因此只能使用以下方法解决:
unsigned long long variable; // NOLINT
后面的注释可以使clang-tidy忽略此行检查。
本文介绍如何应对Clang-Tidy工具在代码审查中报告的Google-Runtime-Int规范问题,特别是当代码需要使用unsigned long long而非uint64_t时的解决方法。

530

被折叠的 条评论
为什么被折叠?



