Skip to content

Commit 55b8fc0

Browse files
authored
Merge pull request #4424 from tautschnig/deprecation-rules
Coding standard: Deprecation rules
2 parents 857e67f + f3a8371 commit 55b8fc0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

CODING_STANDARD.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
Here a few minimalistic coding rules for the CPROVER source tree.
22

3+
# Interfaces
4+
- With any changes, consider the impact on other users of the code base. Users
5+
frequently carry their own set of patches or build tools on top of the code
6+
base. Large-scale changes negatively impact both scenarios.
7+
- Tools that link against the code base can reasonably expect a stable
8+
interface. We consider as public interface any objects, procedures, or classes
9+
(and their methods) that are meant to be used outside a single directory.
10+
- See below for how to document interfaces and how to mark parts of interfaces
11+
as deprecated.
12+
313
# Whitespaces
414

515
Formatting is enforced using clang-format. For more information about this, see
@@ -101,6 +111,16 @@ Formatting is enforced using clang-format. For more information about this, see
101111
- Use comments to explain the non-obvious
102112
- Use #if 0 for commenting out source code
103113
- Use #ifdef DEBUG to guard debug code
114+
- When deprecating interfaces, use the `DEPRECATED` macro, preferably together
115+
with `SINCE`. For example,
116+
```
117+
DEPRECATED(SINCE(2019, 1, 31, "use other_method() instead"))
118+
void deprecated_method();
119+
```
120+
marks `deprecated_method` as deprecated as of 2019-01-31. Any deprecated
121+
functionality should remain in place for at least six months from the date of
122+
deprecation. Before deprecating code, all in-tree uses should be replaced or
123+
marked as deprecated.
104124
105125
# Naming
106126
- Identifiers should make clear the purpose of the thing they are naming.

0 commit comments

Comments
 (0)