Skip to content

Commit e949196

Browse files
author
thk123
committed
Extended the coding standard
Now cover how source list of Makefiles should be structured (to aid merging). Also explain the decisions me and Micahel discussed on #454 regarding sharing command flags between programs.
1 parent 4cfcb87 commit e949196

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

CODING_STANDARD

+29
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,35 @@ Header files:
9292
of the header file rather than in line
9393
- Guard headers with #ifndef CPROVER_DIRECTORIES_FILE_H, etc
9494

95+
Make files
96+
- Each source file should appear on a separate line
97+
- The final source file should still be followed by a trailing slash
98+
- The last line should be a comment to not be deleted, i.e. should look like:
99+
```
100+
SRC = source_file.cpp \
101+
source_file2.cpp \
102+
# Empty last line
103+
```
104+
- This ensures the Makefiles can be easily merged.
105+
106+
Program Command Line Options
107+
- Each program contains a program_name_parse_optionst class which should
108+
contain a define PROGRAM_NAME_PARSE_OPTIONS which is a string of all the
109+
parse options in brackets (with a colon after the bracket if it takes a
110+
parameter)
111+
- Each parameter should be one per line to yield easy merging
112+
- If parameters are shared between programs, they should be pulled out into
113+
a common file and then included using a define
114+
- The defines should be OPT_FLAG_NAMES which should go into the OPTIONS define
115+
- The defines should include HELP_FLAG_NAMES which should contain the help
116+
output of the format:
117+
```
118+
" --flag explanations\n" \
119+
" --another flag more explanation\n" \
120+
<-------30 chars------>
121+
- The defines may include PARSE_OPTIONS_FLAG_NAMES which move the options
122+
from the command line into the options
123+
95124
C++ features:
96125
- Do not use namespaces.
97126
- Prefer use of 'typedef' insted of 'using'.

0 commit comments

Comments
 (0)