Skip to content

Commit d87ac78

Browse files
MisterGCmikir
authored andcommitted
[#493] Improve Functional Safety documentation in README.md
1 parent 79d1535 commit d87ac78

File tree

2 files changed

+35
-30
lines changed

2 files changed

+35
-30
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ More documentation? Go to the [Documentation](#documentation).
3838
## Language support
3939

4040
At the moment the following code generators are available
41-
- [C++ Generator](compiler/extensions/cpp/README.md) with [C++ Runtime Library](https://zserio.org/doc/runtime/latest/cpp)
42-
supporting [functional safety](compiler/extensions/cpp/README.md#functional-safety-features)
43-
- [Java Generator](compiler/extensions/java/README.md) with [Java Runtime Library](https://zserio.org/doc/runtime/latest/java)
44-
- [Python Generator](compiler/extensions/python/README.md) with [Python Runtime Library](https://zserio.org/doc/runtime/latest/python)
41+
- C++: [Generator](compiler/extensions/cpp/README.md) and [Runtime Library](https://zserio.org/doc/runtime/latest/cpp) using C++11,
42+
and developed with special attention to [functional safety](compiler/extensions/cpp/README.md#functional-safety)
43+
and [performance](https://github.com/ndsev/zserio-protobuf-benchmarks)
44+
- Java: [Generator](compiler/extensions/java/README.md) and [Runtime Library](https://zserio.org/doc/runtime/latest/java)
45+
- Python: [Generator](compiler/extensions/python/README.md) and [Runtime Library](https://zserio.org/doc/runtime/latest/python)
4546

4647
In addition to these, zserio provides specialized text generators for documentation and export
4748
- [Doc Generator](compiler/extensions/doc/README.md)

compiler/extensions/cpp/README.md

+30-26
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@ For a **quick start** see the [C++ Tutorial](https://github.com/ndsev/zserio-tut
66

77
For an **API documentation** see the [C++ Runtime Library](https://zserio.org/doc/runtime/latest/cpp).
88

9-
## Functional Safety Features
9+
## Functional Safety
10+
11+
Zserio's C++ support is designed with a strong focus on functional safety, aiming to ensure the reliability,
12+
integrity, and robustness of the system while reducing the risk of software-induced hazards. This section
13+
provides an overview of the functional safety measures implemented, highlighting development practices that
14+
contribute to the framework's safety and trustworthiness.
1015

1116
### C++ Runtime Library
1217

1318
The following describes features which minimize the risk of Zserio C++ runtime library malfunctioning behavior:
1419

15-
- Supported compilers (minimum versions): gcc 5.4.0, clang 8, MinGW 5.4.0, MSVC 2017
16-
- Warnings are treaded as errors for all supported compilers
17-
- All features are properly tested by unit tests for all supported compilers (>600 tests)
18-
- Implemented automatic check of test coverage threshold with the for
19-
[clang](https://zserio.org/doc/runtime/latest/cpp/coverage/clang/index.html) builds (>98%)
20+
- Supported compilers (minimum versions): gcc 5.4.0, Clang 8, MinGW 5.4.0, MSVC 2017
21+
- Warnings are treated as errors for all supported compilers
22+
- All features are properly tested by [unit test](runtime/test/) for all supported compilers (>600 tests)
23+
- Implemented automatic test coverage threshold check using [llvm-cov](https://llvm.org/docs/CommandGuide/llvm-cov.html) and Clang 8 (see
24+
[coverage report](https://zserio.org/doc/runtime/latest/cpp/coverage/clang/index.html) which fulfills a line coverage threshold of 98%)
2025
- AddressSanitizer is run with no findings
2126
- UndefinedBehaviourSanitizer is run with no findings
2227
- C++ runtime library sources are checked by static analysis tool clang-tidy version 14
@@ -26,41 +31,40 @@ The following describes features which minimize the risk of Zserio C++ runtime l
2631
Clang-tidy tool is run using [this configuration](https://github.com/ndsev/zserio/blob/master/compiler/extensions/cpp/runtime/ClangTidyConfig.txt).
2732
The clang-tidy report from the latest C++ runtime library is available [here](https://zserio.org/doc/runtime/latest/cpp/clang-tidy/clang-tidy-report.txt).
2833

29-
Because C++ runtime library is very low level (e.g. it mimics `std::span` or `std::string_view` standard
30-
abstraction from C++17), it was not possible to fix all clang-tidy findings.
34+
Due to compatibility and functional safety considerations (as there are no available MISRA/AUTOSAR guidelines
35+
for C++ standards newer than C++14), zserio is constrained to utilize the C++11 standard. Consequently, certain
36+
clang-tidy findings remain unresolved at present. This is mainly attributed to zserio's C++ runtime library,
37+
which operates at a lower level and emulates standard abstractions like std::span or std::string_view introduced
38+
in C++17.
3139

3240
Therefore all clang-tidy findings have been carefully checked and filtered out using definitions in clang-tidy
33-
[suppression file](https://github.com/ndsev/zserio/blob/master/compiler/extensions/cpp/runtime/ClangTidySuppressions.txt).
41+
[suppression file](runtime/ClangTidySuppressions.txt).
3442
This suppression file contains as well the brief reasoning why these findings were not fixed. This solution
3543
with suppression file has been chosen not to pollute C++ runtime sources with `// NOLINT` comments and to
3644
allow implementation of warnings-as-error feature. The clang-tidy suppression file is automatically used
37-
during compilation using `CMake`.
38-
45+
during compilation using CMake (see [CMake Runtime Configuration](runtime/CMakeLists.txt)).
3946

4047
### C++ Generated Code
4148

4249
The following describes features which minimize the risk of Zserio C++ generated code malfunctioning behavior:
4350

4451
- Supported compilers (minimum versions): gcc 5.4.0, clang 8, MinGW 5.4.0, MSVC 2017
45-
- Warnings are treaded as errors for all supported compilers
46-
- All features are properly tested by unit tests for all supported compilers (>1700 tests)
47-
- Generated C++ sources are checked by static analysis tool clang-tidy version 14 using
48-
[this configuration](https://github.com/ndsev/zserio/blob/master/compiler/extensions/cpp/runtime/ClangTidyConfig.txt)
52+
- Warnings are treated as errors for all supported compilers
53+
- All zserio language features are properly tested by [unit tests](../../test) for all supported compilers
54+
(>1700 tests)
55+
- Unit tests check C++ code generated from small zserio schemas (>70 schemas)
56+
- Generated sources are checked by static analysis tool clang-tidy version 14 using
57+
[this configuration](runtime/ClangTidyConfig.txt)
4958

5059
### Exceptions
5160

52-
Zserio C++ runtime library together with the C++ generated code can throw a `zserio::CppRuntimeException` in
53-
some rare circumstances, mainly
54-
55-
- during parsing (reading)
56-
- during writing
57-
- in reflection code
58-
- in type info code
59-
60-
Because there are hundreds possibilities when exception `zserio::CppRuntimeException` can be thrown, the
61-
following section contains only description of exceptions during parsing.
61+
In functional-critical systems, the primary use case of zserio involves reading data. The zserio C++ runtime
62+
library, along with the generated C++ code, may throw a `zserio::CppRuntimeException` in rare circumstances.
63+
These exceptions can occur during reading, writing, and within its reflection functionality. While there are
64+
numerous possibilities for when the `zserio::CppRuntimeException` exception can be thrown, this section
65+
focuses specifically on describing exceptions that may occur during reading.
6266

63-
#### Exceptions During Parsing
67+
#### Exceptions During Reading
6468

6569
The following table describes all possibilities when C++ generated code can throw
6670
a `zserio::CppRuntimeException` during parsing of binary data:

0 commit comments

Comments
 (0)