From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [GIT] Networking Date: Thu, 3 Sep 2015 11:31:40 -0700 Message-ID: References: <20150902.223522.1792493140210966693.davem@davemloft.net> <20150903.104032.767889134756094076.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Lorenzo Bianconi , Johannes Berg , Andrew Morton , Network Development , Linux Kernel Mailing List To: David Miller Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Thu, Sep 3, 2015 at 11:22 AM, Linus Torvalds wrote: > [-Wsizeof-array-argument] Ahh. Google shows that it's an old clang warning that gcc has recently picked up. But even clang doesn't seem to have any way for a project to say "please warn about arrays in function argument declaration". It *is* very traditional idiomatic C, it's just that I personally think it's one of those bad traditional C things exactly because it's so misleading about what actually goes on. But I guess that in practice, the only thing that it actually *affects* is "sizeof" (and assignment to the variable name - something that would be invalid for a real array, but works on argument arrays because they are really just pointers). The "array as function argument" syntax is occasionally useful (particularly for the multi-dimensional array case), so I very much understand why it exists, I just think that in the kernel we'd be better off with the rule that it's against our coding practices. Linus