Browse Source

Merge #10381: Shadowing warnings are not enabled by default, update doc accordingly

f203ecc Shadowing is not enabled by default, update doc accordingly. (Pavel Janík)

Tree-SHA512: a7170827caa9d35457356808445ef2387fd2edde72fb76c6241cfd5decad218558b307d223e86bb66041576b638f90f6efa8a46ea6208d43da275a993617c997
pull/1/head
Wladimir J. van der Laan 5 years ago
parent
commit
7f2b9e0868
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 7
      doc/developer-notes.md

7
doc/developer-notes.md

@ -343,10 +343,9 @@ Strings and formatting @@ -343,10 +343,9 @@ Strings and formatting
Variable names
--------------
The shadowing warning (`-Wshadow`) is enabled by default. It prevents issues rising
from using a different variable with the same name.
Please name variables so that their names do not shadow variables defined in the source code.
Although the shadowing warning (`-Wshadow`) is not enabled by default (it prevents issues rising
from using a different variable with the same name),
please name variables so that their names do not shadow variables defined in the source code.
E.g. in member initializers, prepend `_` to the argument name shadowing the
member name:

Loading…
Cancel
Save