1
1
Here a few minimalistic coding rules for the cprover source tree:
2
2
3
- a) 2 spaces indent, no tabs
4
- b) no "using namespace std;"
5
- c) Avoid new/delete, use containers instead.
6
- d) Avoid unnecessary #includes, especially in header files
7
- e) No lines wider than 80 chars
8
- f) Put matching { } into the same column
9
- g) If a method is bigger than a page, break it into parts
10
- h) Avoid destructive updates if possible. The irept has
11
- constant time copy.
3
+ - Use 2 spaces indent, no tabs.
4
+ - No lines wider than 80 chars.
5
+ - If a method is bigger than a page, break it into parts.
6
+ - Put matching { } into the same column.
7
+ - Do not use namespaces.
8
+ - Prefer use of 'typedef' insted of 'using'.
9
+ - Prefer use of 'class' instead of 'struct'.
10
+ - User defined type identifiers have to be terminated by 't'. Moreover,
11
+ before 't' may not be '_'.
12
+ - Avoid new/delete, use containers instead. In other words, do not perform
13
+ heap operations directly.
14
+ - Write type modifiers before the type specifier.
15
+ - Do not use 'm_' prefix nor '_' suffix for names of attributes of structured
16
+ types.
17
+ - Avoid destructive updates if possible. The irept has
18
+ constant time copy.
19
+ - Avoid unnecessary #includes, especially in header files
20
+ - We allow to use 3rd libraries directly. No wrapper matching the coding rules
21
+ is required. Allowed libraries are: C++ standard library.
22
+ - No "using namespace std;".
23
+ - Use instances of std::size_t for comparison with return values of .size() of
24
+ SLT containers and algorithms, and use them as indices to arrays or vectors.
25
+ - Prohibited stuff from the standard library: ??? TODO!
12
26
13
27
Architecture-specific code:
14
28
15
- a) Avoid if possible.
16
- b) Use __LINUX__, __MACH__, and _WIN32 to distinguish the architectures.
17
- c) Don't include architecture-specific header files without #ifdef ...
29
+ - Avoid if possible.
30
+ - Use __LINUX__, __MACH__, and _WIN32 to distinguish the architectures.
31
+ - Don't include architecture-specific header files without #ifdef ...
0 commit comments