NSS/C++

From MozillaWiki
< NSS
Jump to: navigation, search

With MozPkix in NSS C++ is officially allowed in NSS. This page collects a number of rules for C++ code in NSS.

Dependencies

The code MUST NOT depend on anything other than libstdc++.

APIs

All public facing APIs must be C APIs, wrapping the C++ code.

Target Compiler

All C++ must be compilable with GCC 4.4.x. Note that this requirement changes depending on RHEL's default compiler. Also note that GCC 4.4.x tests are limited on CI and mozpkix does not adhere to this requirement at this point. The list of supported C++11 features in GCC 4.4.x can be found here or here.

Notable limitations

The following are notable C++ features that can NOT be used with GCC 4.4.x

  • nullptr is not available
  • Template aliases are not supported
  • The explicit operator
  • Range-based for loops

Formatting

C++ code in NSS must be formatted according to the Google Cpp clang-format-3.9 style.