Skip to content
Snippets Groups Projects
Commit b8916aa2 authored by vjpai's avatar vjpai
Browse files

Don't global initialize anything to nullptr

parent b31a9a09
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,12 @@ default capture). Other C++ functional features such as
(../include/grpc++/impl/codegen/config.h). Instead, pointers should
be checked for validity using their implicit conversion to `bool`.
In other words, use `if (p)` rather than `if (p != nullptr)`
- Do not initialize global/static pointer variables to `nullptr`. Just let
the compiler implicitly initialize them to `nullptr` (which it will
definitely do). The reason is that `nullptr` is an actual object in
our implementation rather than just a constant pointer value, so
static/global constructors will be called in a potentially
undesirable sequence.
- Do not use `final` or `override` as these are not supported by some
compilers. Instead use `GRPC_FINAL` and `GRPC_OVERRIDE` . These
compile down to the traditional C++ forms for compilers that support
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment