From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED25634D4D6; Thu, 5 Mar 2026 23:44:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772754277; cv=none; b=f8IYx7m66ADuyvXsFmMM1eo4EGZBDzLBTzVglp52UuFrfNhMLkXYJy1n0Vx8Sx3fda5YPCijXSaK2GJA/T0JhqMaIJsqtktChqsqgUlYcWeIWmyV+qIFsCLEw78ovj5Umiu4APe+uusMfZ6DXaAkIkgsRojiIjpY0VbmuMMEdDI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772754277; c=relaxed/simple; bh=iauzQaGDXiC231/mypgQatCf2nfYRe0nN8HUXliGuCs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=R8FMYjeVtokUXzaGEEW8Q8wleVLIcoea5JSHcp55HjlFjYF4qGcN3hvWs56h1FGYOcUsH26nMcuSLtB6YTgM4dtYFatxZ0TWt/UhoKDBYIEg3SxtId0dF4gOIpC0BSqINiqwOWZSNb2F6A8s+fSzOGgjKDaWkL8DSucRuioG4HY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=NiuHMNof; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="NiuHMNof" Received: from [172.27.2.41] (c-76-133-66-138.hsd1.ca.comcast.net [76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 625NhY3o4127751 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Thu, 5 Mar 2026 15:43:35 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 625NhY3o4127751 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2026022301; t=1772754218; bh=W+08PYjDQhAaObzzVmi0H3Jb7j0xETdylBL3/4YZEk8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=NiuHMNofaKp4X3OTkTE4sx+ETMmwUFwgJjU83eBnK2/BqKkOamVxH8/VjJ6FOT+rj cX8EORzUxiaeuPL/1KqpN374d4Fv+bjiIc9qbH2fAFX6suJ7cqLLdsFwbLkHnOb4e/ 4rbho2As0pJPemgWwc3J3VEGg1b0DHzc5RkY8zixe6iRpSUQIEDHsEBxGqiEhzlUvB SdoTrvFmB+3vG9ZsjdkJ/n76P3jMN/BwJ0h8M1f7ogLYnkjnS0DdO4PbTJCc0rLtsz xxrlilrcBpzg9J0XWBj/4aaFK7REjIiRGJ0ywiqx438ZCLfQPfIZNO74P6Ue7O7SPu 4MLF4w7uvkNjQ== Message-ID: <01433066-eb9b-4a96-8d7f-794af941d365@zytor.com> Date: Thu, 5 Mar 2026 15:43:29 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] kbuild: Switch from '-fms-extensions' to '-fms-anonymous-structs' when available To: Nathan Chancellor , Nicolas Schier Cc: Linus Torvalds , Catalin Marinas , Will Deacon , Huacai Chen , WANG Xuerui , "James E.J. Bottomley" , Helge Deller , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Ard Biesheuvel , Ilias Apalodimas , Nick Desaulniers , Bill Wendling , Justin Stitt , Kees Cook , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-efi@vger.kernel.org, llvm@lists.linux.dev References: <20260223-fms-anonymous-structs-v1-0-8ee406d3c36c@kernel.org> Content-Language: en-US, sv-SE From: "H. Peter Anvin" In-Reply-To: <20260223-fms-anonymous-structs-v1-0-8ee406d3c36c@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2026-02-23 11:10, Nathan Chancellor wrote: > Hi all, > > The kernel enabled '-fms-extensions' in commit c4781dc3d1cf ("Kbuild: > enable -fms-extensions") in 6.19 to gain access to a Microsoft > (originally Plan 9) extension around including a tagged structure/union > anonymously in an other structure/union. Since then, Clang 23.0.0 > (current main) has added a flag to enable only that extension, rather > than all Microsoft extensions, '-fms-anonymous-structs' [1]. Using this > narrower compiler option would have avoided the build error fixed by > commit a6773e6932cb ("jfs: Rename _inline to avoid conflict with clang's > '-fms-extensions'"). While these errors are not expected to be common, > using the narrower option when available has no drawbacks because the > kernel only cares about this extension in '-fms-extensions', no others. > While this could result in build errors for folks using > '-fms-anonymous-structs' if a developer uses another extension in > '-fms-extensions' (either intentionally or unintentionally), flagging > these uses for further scrutiny seems worthwhile. > > This series converts the build system to use that flag when it is > available. The first patch consolidates all of the C dialect flags into > a single variable to make future updates to the dialect flags less > painful, as updating the logic in every place that uses their custom > built C flags is getting cumbersome (and C23 is looming). The second > patch makes the actual switch. > > I would like Nicolas to carry this in the Kbuild tree for 7.1, please > provide Acks as necessary. > > [1]: https://github.com/llvm/llvm-project/commit/c391efe6fb67329d8e2fd231692cc6b0ea902956 > Question: does clang allow this with __extension__, or only if the option is on the command line? It would be desirable in the long run if both clang and gcc would allow this with __extension__, as that would be required to use it in uapi headers (at least without some doable-but-nontrivial preprocessing, which might be worthwhile to do anyway...) -hpa