Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E38FC63697 for ; Tue, 17 Nov 2020 21:11:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9FF84241A5 for ; Tue, 17 Nov 2020 21:11:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="O3VCaSkl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727969AbgKQVLA (ORCPT ); Tue, 17 Nov 2020 16:11:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:50516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbgKQVK7 (ORCPT ); Tue, 17 Nov 2020 16:10:59 -0500 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 69A4224181; Tue, 17 Nov 2020 21:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605647459; bh=CVsEJQhlAVMIEhKs3dLg2pxzQZiktYMz9QymkpXu76Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O3VCaSkllAQnEZ4r0gmy4oy+D9dehPvszTMlb8piSMof9VU3FTxI5jtwvoVzpjsPR 7dQLSKjf/QZIQbqgKsHSZq+tfujbD1J6oDf0MvF+uOeXQ11dL8irJXGuYwlvvZel5w NSqdUzZspZSMdzcfraQIDGCzzweMEdxCE2OGe/mk= Date: Tue, 17 Nov 2020 21:10:53 +0000 From: Will Deacon To: Linus Torvalds Cc: Jakub Jelinek , Peter Zijlstra , "gcc@gcc.gnu.org" , linux-toolchains@vger.kernel.org, "Uecker, Martin" , "amonakov@ispras.ru" , "ubizjak@gmail.com" , "luto@kernel.org" Subject: Re: Re: typeof and operands in named address spaces Message-ID: <20201117211053.GA32727@willie-the-truck> References: <1605437478.5370.9.camel@med.uni-goettingen.de> <20201116111056.GA3121378@hirez.programming.kicks-ass.net> <20201117192530.GA3788@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org On Tue, Nov 17, 2020 at 11:31:57AM -0800, Linus Torvalds wrote: > On Tue, Nov 17, 2020 at 11:25 AM Jakub Jelinek wrote: > > > > It would need to be typeof( (typeof(type)) (type) ) to not be that > > constrained on what kind of expressions it accepts as arguments. > > Yup. > > > Anyway, it won't work with array types at least, > > int a[10]; > > typeof ((typeof (a)) (a)) b; > > is an error (in both gcc and clang), while typeof (a) b; will work > > (but not drop the qualifiers). Don't know if the kernel cares or not. > > Well, the kernel already doesn't allow that, because our existing > horror only handles simple integer scalar types. > > So that macro is a clear improvement - if it actually works (local > testing says it does, but who knows about random compiler versions > etc) I'll give it a go now, although if it works I honestly won't know whether to laugh or cry. Will