Re: [PATCH v6 01/11] block: Simplify QAPI_LIST_ADD

2020-10-27 Thread Markus Armbruster
Eric Blake writes: > There is no need to rely on the verbosity of the gcc/clang compiler > extension of g_new(typeof(X), 1) when we can instead use the standard > g_malloc(sizeof(X)). In general, we like g_new over g_malloc for > returning type X rather than void* to let the compiler catch more

Re: [PATCH v6 01/11] block: Simplify QAPI_LIST_ADD

2020-10-27 Thread Vladimir Sementsov-Ogievskiy
27.10.2020 08:05, Eric Blake wrote: There is no need to rely on the verbosity of the gcc/clang compiler extension of g_new(typeof(X), 1) when we can instead use the standard g_malloc(sizeof(X)). In general, we like g_new over g_malloc for returning type X rather than void* to let the compiler ca

[PATCH v6 01/11] block: Simplify QAPI_LIST_ADD

2020-10-26 Thread Eric Blake
There is no need to rely on the verbosity of the gcc/clang compiler extension of g_new(typeof(X), 1) when we can instead use the standard g_malloc(sizeof(X)). In general, we like g_new over g_malloc for returning type X rather than void* to let the compiler catch more potential typing mistakes, bu