moneymanagerex / moneymanagerex

Money Manager Ex is an easy to use, money management application built with wxWidgets
http://moneymanagerex.org
GNU General Public License v2.0
1.7k stars 269 forks source link

Cpp Coding Standards #1950

Open vomikan opened 5 years ago

vomikan commented 5 years ago

Prefixes are sometimes useful: Is - to ask a question about something. Whenever someone sees Is they will know it's a question. Get - get a value. Set - set a value.

slodki commented 5 years ago

g++ -Wold-style-cast:

Warn if an old-style (C-style) cast to a non-void type is used within a C++ program. The new-style casts ("dynamic_cast", "static_cast", "reinterpret_cast", and "const_cast") are less vulnerable to unintended effects and much easier to search for.

slodki commented 5 years ago

Additionally, the C++11 standard specifies the following additional rules:

This can be checked with -Wdeprecated-copy in latest GCC 9:

Warn that the implicit declaration of a copy constructor or copy assignment operator is deprecated if the class has a user-provided copy constructor or copy assignment operator, in C++11 and up. This warning is enabled by -Wextra. With -Wdeprecated-copy-dtor, also deprecate if the class has a user-provided destructor.

slodki commented 5 years ago

Build log from GCC 9 with above mentioned warnings: https://travis-ci.org/slodki/moneymanagerex/jobs/525613018#L441