我在C / C ++代码中使用长块C风格的Doxygen注释。这是http://www.doxygen.nl/manual/docblocks.html上列出的#4样式,看起来像这样(用完80个字符)...
/**************************************************************************//**
* \file
* \date 2017-01-02
* \author Alex Hogen
******************************************************************************/
Run Code Online (Sandbox Code Playgroud)
如果我对此运行clang-format,它将在两个正斜杠之间插入一个空格,因此看起来像是愚蠢的……。
/**************************************************************************/ /**
* \file
* \date 2017-01-02
* \author Alex Hogen
******************************************************************************/
Run Code Online (Sandbox Code Playgroud)
SpacesBeforeTrailingComments设置为2,所以那不是问题。CommentPragmas正则表达式\/\*+\/\/\*+。CommentPragmas正则表达式/\*(.+\n.+)+\*/ReflowComments为false...但是这些都不起作用。
我知道在此块中有两个注释,但是在同一行上找不到任何clang-format参数寻址块注释。如何停止clang格式插入此空间?
我不想通过为每个Doxygen注释块禁用clang格式来解决此问题。这似乎很荒谬。
有什么好的建议吗?:-)
我正在编写 Makefile 并设置 Docker 映像以在 CI 环境中进行构建。在这些不同的脚本中,我想打印我正在设置和/或使用的工具的版本。
gcc --version显示简单的版本号以及一些版权和许可信息。我的机器上的示例输出:
$ gcc --version
gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Run Code Online (Sandbox Code Playgroud)
有没有更简单的方法来获取版本信息而不解析此输出?