2 changes: 1 addition & 1 deletion 2 clang/docs/ClangFormatStyleOptions.rst Original file line numberDiff line numberDiff line change @@ -5730,7 +5730,7 @@ Examples ======== A style similar to the `Linux Kernel
A style similar to the Linux Kernel style: CopyBasedOnStyle: LLVM IndentWidth: 8 UseTab: Always BreakBeforeBraces: Linux AllowShortIfStatementsOnASingleLine: false IndentCaseLabels: false The result is (imagine that tabs are used for indentation here): Copyvoid test() { switch (x) { case...
上面的例子只是写来测试,要看clang-format的格式化效果,直接在github上看对应项目的代码即可,比如Linux kernel。 uncrustify这工具现在在github维护,也是比较活跃,但我没见过用这个工具格式化的项目,而且上面也给出了格式化的效果,这里就不再测试了。 astyle在sourceforge上,更新并不频繁,格式化选项比较少,比如说没有提...
Some of clang-format's features relevant for the kernel are: * Uses clang's tooling support behind the scenes to parse and rewrite the code. It is not based on ad-hoc regexps. * Supports reasonably well the Linux kernel coding style. * Fast enough to be used at the press of a key...
forked from编程语言算法集/Clang 确定同步? 同步操作将从编程语言算法集/Clang强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!! 确定后同步将在后台操作,完成时将刷新页面,请耐心等待。 删除在远程仓库中不存在的分支和标签 同步Wiki(当前仓库的 wiki 将会被覆盖!) ...
基于GNU的clang-format修改 基于GNU的默认格式,想修改为函数返回类型后面不换行。 根据官方文档,http://clang.llvm.org/docs/ClangFormatStyleOptions.html, AlwaysBreakAfterDefinitionReturnType已经不建议使用,所以只添加了AlwaysBreakAfterReturnType: None 结果格式化代码函数返回类型后面依然会换行。尝试多次......
If we do some speed benchmark about the search engine on a big source project like a Linux driver with all kernel includes. #!/usr/bin/env python2 ## -*- coding: utf-8 -*- from SCAF.API.Analysis import * analysis = SCAFAnalysis('localhost', 'login', 'pwd') analysis.useDatabase...
另外,clang-format不能指定配置文件的路径,而我不喜欢把这些文件和源代码文件放在一起,为此还写了个批量格式化的脚本。上面的例子只是写来测试,要看clang-format的格式化效果,直接在github上看对应项目的代码即可,比如Linux kernel。 uncrustify这工具现在在github维护,也是比较活跃,但我没见过用这个工具格式化的项目,而且...
This is useful to format files in the tools directory (e.g. selftests) with the same coding style as the kernel. Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Tom Rix <trix@redhat.com> Signed-off-by: Mickaël Salaün <mic@digikod.net> Link: https://lore.kernel.org/r/20220506160106.52...
clang-format-14 -i security/landlock/*.[ch] include/uapi/linux/landlock.h Link: https://lore.kernel.org/r/20220506160513.523257-3-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün <mic@digikod.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation....