From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753412AbdJUP7r (ORCPT ); Sat, 21 Oct 2017 11:59:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:55719 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753363AbdJUP7p (ORCPT ); Sat, 21 Oct 2017 11:59:45 -0400 Subject: Re: [PATCH] cgroup: reorder flexible array members of struct cgroup_root To: Tejun Heo , Nick Desaulniers Cc: Li Zefan , Johannes Weiner , cgroups@vger.kernel.org, Linux Kernel Mailing List , Matthias Kaehlcke , Michael Davidson , Greg Hackmann , android-llvm@google.com References: <20171017063322.11455-1-nick.desaulniers@gmail.com> <20171018133010.GD1302522@devbig577.frc2.facebook.com> <20171021153253.GG1302522@devbig577.frc2.facebook.com> From: Aleksa Sarai Message-ID: <85d7f6eb-7869-551d-01b1-fa1712f4bd40@suse.de> Date: Sun, 22 Oct 2017 02:59:33 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171021153253.GG1302522@devbig577.frc2.facebook.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Here, not necessarily but I don't want to move it for a bogus reason. > Why would we disallow embedding structs with flexible members in the > middle when it can be done and is useful? If we want to discuss > whether we want to avoid such usages in the kernel (but why?), sure, > let's have that discussion but we can't decide that on "clang warns on > it by default". There was a talk a few years ago by the clang folks[1] saying that while trying to build a kernel with clang, they discovered that several places in the kernel uses "VLAIS" (variable Length Arrays In Structs") and argued that this is a violation of the C specification, despite it being a GNU extension. They also submitted several patches that removed this code (even working around a user-space visible usage of VLAIS). [1]: https://www.linuxplumbersconf.org/2013/ocw/system/presentations/1221/original/VLAIS.pdf -- Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH https://www.cyphar.com/