-
Notifications
You must be signed in to change notification settings - Fork 8
/
CODING_STYLE
16 lines (15 loc) · 960 Bytes
/
CODING_STYLE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Coding style used for IDADWARF:
* 2 spaces for an indent.
* Automatic variables are always initialized.
* I tried to apply const-correctness as much as possible.
The const qualifier is placed at the right of the type (that is: int const my_var = 0;)
* Primitive types are passed by address when the function modifies them.
Objects are always passed by reference.
* There is only one "return" statement per function: there are no "early" returns.
That means a function can "exit" only at the end of its definition.
* Exceptions are used. The code uses RAII and auto pointers to be exception-safe.
RAII wrappers have been created for libdwarf objects (compilation units, DIEs, ...)
A call to the wrapped libdwarf may throw an exception. They are catched in the DIE visitor,
or elsewhere when needed.
* Many GCC extensions have been used ("?:" operator, ## __VA_ARGS, various GCC attributes, ...)
So, I think the code will only compile with g++ :)