diff --git a/g3doc/style-guide.md b/g3doc/style-guide.md index 9d713c68c9..44c752173b 100644 --- a/g3doc/style-guide.md +++ b/g3doc/style-guide.md @@ -173,6 +173,16 @@ headers you need. [goog-forward-declarations]: https://google.github.io/styleguide/cppguide.html#Forward_Declarations +### RTTI and dynamic_cast + +The Google style guide [permits the use of dynamic_cast](https://google.github.io/styleguide/cppguide.html#Run-Time_Type_Information__RTTI_). + +However, WebRTC does not permit it. WebRTC (and Chrome) is compiled with the +-fno-rtti flag, and the overhead of enabling RTTI it is on the order of 220 +Kbytes (for Android Arm64). + +Use static_cast and take your own steps to ensure type safety. + ## C There's a substantial chunk of legacy C code in WebRTC, and a lot of it is old