mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
Add clang lifetimebound section to developer notes
This commit is contained in:
parent
e66b321fd1
commit
654284209f
1 changed files with 11 additions and 0 deletions
|
@ -32,6 +32,7 @@ Developer Notes
|
||||||
- [C++ data structures](#c-data-structures)
|
- [C++ data structures](#c-data-structures)
|
||||||
- [Strings and formatting](#strings-and-formatting)
|
- [Strings and formatting](#strings-and-formatting)
|
||||||
- [Shadowing](#shadowing)
|
- [Shadowing](#shadowing)
|
||||||
|
- [Lifetimebound](#lifetimebound)
|
||||||
- [Threads and synchronization](#threads-and-synchronization)
|
- [Threads and synchronization](#threads-and-synchronization)
|
||||||
- [Scripts](#scripts)
|
- [Scripts](#scripts)
|
||||||
- [Shebang](#shebang)
|
- [Shebang](#shebang)
|
||||||
|
@ -885,6 +886,16 @@ please name variables so that their names do not shadow variables defined in the
|
||||||
When using nested cycles, do not name the inner cycle variable the same as in
|
When using nested cycles, do not name the inner cycle variable the same as in
|
||||||
the outer cycle, etc.
|
the outer cycle, etc.
|
||||||
|
|
||||||
|
Lifetimebound
|
||||||
|
--------------
|
||||||
|
|
||||||
|
The [Clang `lifetimebound`
|
||||||
|
attribute](https://clang.llvm.org/docs/AttributeReference.html#lifetimebound)
|
||||||
|
can be used to tell the compiler that a lifetime is bound to an object and
|
||||||
|
potentially see a compile-time warning if the object has a shorter lifetime from
|
||||||
|
the invalid use of a temporary. You can use the attribute by adding a `LIFETIMEBOUND`
|
||||||
|
annotation defined in `src/attributes.h`; please grep the codebase for examples.
|
||||||
|
|
||||||
Threads and synchronization
|
Threads and synchronization
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue