Skip to content

Commit

Permalink
调整格式
Browse files Browse the repository at this point in the history
github markdown 展示方式有变,标题下划线会遮盖 logo,现修正
  • Loading branch information
brotherbeer authored Apr 19, 2024
1 parent fc237b6 commit 60fec0a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
8 changes: 3 additions & 5 deletions c-cpp-rules.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<img src="logo.png" align="right"/>

# C/C++ 安全规则集合 ![Version](https://img.shields.io/badge/version-1.3.2-brightgreen)
# C/C++ 安全规则集合 ![Version](https://img.shields.io/badge/version-1.3.2-brightgreen) <img src="./logo.png" align="right" width="auto" height="100"/>

> Bjarne Stroustrup: “*C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off.*”

&emsp;&emsp;针对 CC++ 语言,本文收录了 525 种需要重点关注的问题,可为制定编程规范提供依据,也可为代码审计以及相关培训提供指导意见,适用于桌面、服务端以及嵌入式等软件系统。
&emsp;&emsp;针对 CC++ 语言,本文收录了 525 种需要重点关注的问题,可为制定编程规范提供依据,也可为代码审计以及相关培训提供指导意见,适用于桌面、服务端以及嵌入式等软件系统。
&emsp;&emsp;每个问题对应一条规则,每条规则可直接作为规范条款或审计检查点,本文是适用于不同应用场景的规则集合,读者可根据自身需求从中选取某个子集作为规范或审计依据,从而提高软件产品的安全性。
<br/>

Expand Down Expand Up @@ -2915,7 +2913,7 @@ ID_nonStandardCharInHeaderName &emsp;&emsp;&emsp;&emsp;&nbsp; :no_entry: precomp
#include <foo.h> // Compliant
#include <foo_bar> // Compliant
```
可以用 / 作为路径分隔符,但不应出现 // 或 /\*, 否则会导致未定义的行为,如:
可以用 / 作为路径分隔符,但不应出现 // 或 /\*,否则会导致未定义的行为,如:
```
#include <foo//bar.h> // Non-Compliant, undefined behavior
#include <foo/*bar.h> // Non-Compliant, undefined behavior
Expand Down
4 changes: 1 addition & 3 deletions c-ub-list.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<img src="logo.png" align="right"/>

# 附录:C 未定义行为成因列表 ![Version](https://img.shields.io/badge/version-1.3.2-brightgreen)
# 附录:C 未定义行为成因列表 ![Version](https://img.shields.io/badge/version-1.3.2-brightgreen) <img src="./logo.png" align="right" width="auto" height="100"/>

&emsp;&emsp;未定义的行为(Undefined Behavior),指程序不可预测的执行效果,一般由错误的代码实现引起。出于效率、兼容性等多方面原因,语言标准不便于定义错误程序的明确行为,而是将其统称为“未定义”的行为,可以是崩溃,也可以是非预期的任意表现,有些问题在编译器和执行环境的特殊处理下也可能不会造成实质性的危害,但不具备可移植性。代码质量管理的一个重要目标就是消除会导致未定义行为的代码。

Expand Down
4 changes: 1 addition & 3 deletions cpp-ub-list.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<img src="logo.png" align="right"/>

# 附录:C++ 未定义行为成因列表 ![Version](https://img.shields.io/badge/version-1.3.2-brightgreen)
# 附录:C++ 未定义行为成因列表 ![Version](https://img.shields.io/badge/version-1.3.2-brightgreen) <img src="./logo.png" align="right" width="auto" height="100"/>

&emsp;&emsp;未定义的行为(Undefined Behavior),指程序不可预测的执行效果,一般由错误的代码实现引起。出于效率、兼容性等多方面原因,语言标准不便于定义错误程序的明确行为,而是将其统称为“未定义”的行为,可以是崩溃,也可以是非预期的任意表现,有些问题在编译器和执行环境的特殊处理下也可能不会造成实质性的危害,但不具备可移植性。代码质量管理的一个重要目标就是消除会导致未定义行为的代码。

Expand Down

0 comments on commit 60fec0a

Please sign in to comment.