File: CODING_STANDARD

package info (click to toggle)
cbmc 4.9-4
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 40,588 kB
  • ctags: 19,198
  • sloc: cpp: 185,860; ansic: 16,162; yacc: 5,343; lex: 4,518; makefile: 954; pascal: 506; sh: 318; perl: 213; java: 206
file content (17 lines) | stat: -rw-r--r-- 634 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Here a few minimalistic coding rules for the cprover source tree:

a) 2 spaces indent, no tabs
b) no "using namespace std;"
c) Avoid new/delete, use containers instead.
d) Avoid unnecessary #includes, especially in header files
e) No lines wider than 80 chars
f) Put matching { } into the same column
g) If a method is bigger than a page, break it into parts
h) Avoid destructive updates if possible. The irept has
   constant time copy.

Architecture-specific code:

a) Avoid if possible.
b) Use __LINUX__, __MACH__, and _WIN32 to distinguish the architectures.
c) Don't include architecture-specific header files without #ifdef ...