Re: sizeof(var) vs sizeof(type), was Re: [PATCH] git: use COPY_ARRAY and MOVE_ARRAY in handle_alias()
- From
Philip Oakley <philipoakley@iee.email>
- Date
- Sep 26, 2019, 15:24 UTC
- Message-ID
- <7bbcf6fa-e36d-4a1e-86e1-437e9e92dab7@iee.email>
- In-Reply-To
- <b79f52f7-4a7e-f7cd-ed8a-cb6cfbadd7b2@gmail.com>
On 26/09/2019 14:36, Derrick Stolee wrote:
Show 9 quoted lines
>>> 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