Skip to main content
3 votes

How to prevent 'global variables' in a big project?

In the new bright world of C++ Core Guidelines (endorsed by no less than Bjarne Himself and current WG21 convener Herb Sutter) - there is Clang-tidy, and its avoid-non-const-global-variables option: ...
No-Bugs Hare's user avatar
1 vote

Should I assume data passed to my function is accurate?

As designed, you cannot check in C that the string is properly initialised. The solution is to change things so the function called is responsible for everything. Don’t pass in a pointer that might be ...
gnasher729's user avatar
  • 46.7k
1 vote

C/C++: Which conversion warnings make sense in practice?

Here's what decades of experience have taught me. Turn on all the conversion warnings and tell the compiler to treat all warnings as errors. The conversions that must happen should be made explicit ...
Adrian McCarthy's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible