CWE-762: Mismatched Memory Management Routines
Even though most programmers understand what is the difference between objects and pointers to them, sometimes it is not entirely clear, which of the ways of accessing the object to choose. We have tried to answer this question below.
Sometimes, we need to create wrapper types. For example, types like
optional and similar.
Usually, these types have an accessor member function called
.get but they also provide the
operator-> to support direct access to the contained value similarly to what ordinary pointers do.
Many programmers are very fond of blaming the compiler for different errors. Let’s talk about it.
Sometimes it seems that things have gone relatively quiet on the year-2038 front. But time keeps moving forward, and the point in early 2038 when 32-bit time_t values can no longer represent times correctly is now less than 21 years away. That may seem like a long time, but the relatively long life cycle of many embedded systems means that some systems deployed today will still be in service when that deadline hits. One of the developers leading the effort to address this problem is Arnd Bergmann; at Linaro Connect 2017 he gave an update on where that work stands.