From: Philip Oakley Date: Thu, 26 Sep 2019 15:24:00 GMT Subject: Re: sizeof(var) vs sizeof(type), was Re: [PATCH] git: use COPY_ARRAY and MOVE_ARRAY in handle_alias() Message-ID: <7bbcf6fa-e36d-4a1e-86e1-437e9e92dab7@iee.email> In-Reply-To: On 26/09/2019 14:36, Derrick Stolee wrote: >>> Another good reason to use "sizeof(var)" instead of sizeof(type)". :) >> That is indeed a very good reason, in addition to getting the type right >> automatically (by virtue of letting the compiler pick it). >> >> Should we make this an explicit guideline in our documentation? > Better yet: can we create a Coccinelle script to fix it automatically? > > -Stolee > How about 'Both'. We can't assume all contributors have Coccinelle on their OS/system. Philip