... | ... | @@ -41,7 +41,7 @@ Use .cc for C++ source files. This is basically a mere preference and to ensure |
|
|
|
|
|
Use .h for C++ header files. This is because we may want to provide a C-callable wrapper for some APIs, and some C++ header files are to be included in a C source file. In that case C-compatible file names will look more natural.
|
|
|
|
|
|
Use all all-lowercase characters for file names. This is consistent with the current recommendation for python, and so it will make the file name convention consistent throughout the BIND10 source tree. Not mixing lower/upper cases will also help avoid name conflicts in a case insensitive file system. Note that this policy may not compatible with C++ class name convention (see below) if the file name is based on the class name (e.g., name "myclass.cc" for the definition of the "Myclass" classs). We explicitly accept the conflict, but note that this means it will effectively prohibit mixing cases in class names ("Myclass" and "!MyClass" may not coexist).
|
|
|
Use all all-lowercase characters for file names. This is consistent with the current recommendation for python, and so it will make the file name convention consistent throughout the BIND10 source tree. Not mixing lower/upper cases will also help avoid name conflicts in a case insensitive file system. Note that this policy may not compatible with C++ class name convention (see below) if the file name is based on the class name (e.g., name "myclass.cc" for the definition of the "Myclass" class). We explicitly accept the conflict, but note that this means it will effectively prohibit mixing cases in class names ("Myclass" and "!MyClass" may not coexist).
|
|
|
|
|
|
Note header files should not include config.h.
|
|
|
</details>
|
... | ... | @@ -540,7 +540,7 @@ when we decided to make the change. |
|
|
It is extremely important to examine all arguments passed into a log
|
|
|
statement to ensure they will produce safe values at runtime:
|
|
|
- Can the argument (or any part of it) be NULL? If so is this taken into account?
|
|
|
- If the argument invokes any fuctions, are they exception safe?
|
|
|
- If the argument invokes any functions, are they exception safe?
|
|
|
- If it involves indirection, does this always resolve into a usable value?
|
|
|
- If it raises an exception, is the exception caught? This includes double errors, i.e., log statements in an exception handler.
|
|
|
- Does it have the intended data type? For example, it is a common oversight that 8-bit integers are displayed as their ASCII character counterpart. To solve this, prepending a unary plus is the recommended solution ([cppreference.com](https://en.cppreference.com/w/cpp/language/operator_arithmetic#Unary_arithmetic_operators): `1. unary plus (promotion). [...] Integral promotion is performed on the operand if it has integral or unscoped enumeration type and determines the type of the result.`).
|
... | ... | @@ -597,7 +597,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib |
|
|
AM_CPPFLAGS += $(BOOST_INCLUDES)
|
|
|
```
|
|
|
|
|
|
This can be overriden on a per-module basis in the file by specifying
|
|
|
This can be overridden on a per-module basis in the file by specifying
|
|
|
the variable module_CPPFLAGS. (Note that if the CPPFLAGS environment
|
|
|
variable is set, its flags are appended to the command line after
|
|
|
AM_CPPFLAGS.)
|
... | ... | @@ -674,4 +674,3 @@ they are not part of the BIND 10's coding guidelines. |
|
|
* Google: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
|
|
|
* Mozilla: https://developer.mozilla.org/en/Mozilla_Coding_Style_Guide
|
|
|
* XORP: http://cvsweb.xorp.org/cgi-bin/cvsweb.cgi/xorp/devnotes/coding-style.txt?rev=1.7;content-type=text%2Fplain |
|
|
|