You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While this is not an actual error, it does not represent Best Practice in C++ programming. In a number of places, such as in AdafruitIO_Group::_init, both malloc and new are used. The use of bare malloc in C++ is frowned upon. It is normally hidden inside the new operator. What is odd is that the computations are of the form var = (char *)malloc(e);
for e being some expression. In C++, this can (and should) be written as var = new char[e];
and therefore the odd mix of malloc/free and new/delete can be avoided.
The text was updated successfully, but these errors were encountered:
While this is not an actual error, it does not represent Best Practice in C++ programming. In a number of places, such as in AdafruitIO_Group::_init, both malloc and new are used. The use of bare malloc in C++ is frowned upon. It is normally hidden inside the new operator. What is odd is that the computations are of the form
var = (char *)malloc(e);
for e being some expression. In C++, this can (and should) be written as
var = new char[e];
and therefore the odd mix of malloc/free and new/delete can be avoided.
The text was updated successfully, but these errors were encountered: