From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 3B1573858C98 for ; Thu, 25 Jan 2024 20:42:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B1573858C98 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=linux.intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3B1573858C98 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706215359; cv=none; b=j+nGQY+jtxi+iV2CPsgO+xDeM36O3Kv7/ad19zX/awROIpfEQUYnEn9ggF24jnXb6DGfmYncQWiN5Zh1FsQW7pTh8a9WpPPM6UA4czjCm24U9I7y3ATL+1AVC9xee8DaNtJ3O7w4Sbc1trWRVuGl3o5uQVcoxUjVywFP/B/k4QA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706215359; c=relaxed/simple; bh=MVrJJBTP7BL+IhNyLH3dZd2KZWWaSoxv0b5bGlgd+3s=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=JtzL9Nb2L2UnHAazOM1fx/1hekt1QhI6A4whKsfLPCKbOAXUl9fbNkqE1R5f+zhGGteHAMcjHr2Wan48XW2coNwwIuciPZnmJEc/XlY2de+0cH0Q1hn2qC9bbQDLrGd0r+atVuK7GJcJdqzjsC+26dkt21PVPas9ZDcB73rWcj8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mgamail.intel.com ([192.198.163.7]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rT6YV-0003Hc-Iq for gcc-patches@gnu.org; Thu, 25 Jan 2024 15:42:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706215356; x=1737751356; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=MVrJJBTP7BL+IhNyLH3dZd2KZWWaSoxv0b5bGlgd+3s=; b=hnI5+19ntqviT5EZowfxmwfqzMZzqB0M7q6VzXT4GTtWeUWGtkXE2+PX DgqaRRoOfgMDODHqndTwApCUFoFzO7ltVujo7YPytLlad8a/MNSv1JLo4 5yj1JtZOLYUeKu0m9KCQBy3ArWo23daO5cXAJlXhvoua098VHUIGOfNxC y9RvHvzZ+C7bWo6GhVGVl/gjkgwNjUHjyYf6U5I1n4cEVeA/3FnqTKlRZ LwkmCJ2ht6Tdlmb/eJQXVw2TPuCMkFmB6KEnKfWUg6B+AJ2g7YYBO3A2A Hj04J3n4G9TRv6G23FK7NLuP8tZ/yxkzG3oXn6fnWYeAHy+oC3AgFHCgp A==; X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="23747418" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="23747418" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2024 12:39:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="877164326" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="877164326" Received: from tassilo.jf.intel.com (HELO tassilo) ([10.54.38.190]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2024 12:39:38 -0800 Date: Thu, 25 Jan 2024 12:39:32 -0800 From: Andi Kleen To: Joseph Myers Cc: gcc-patches@gnu.org Subject: Re: [PATCH v2 3/5] C: Implement musttail attribute for returns Message-ID: References: <20240124193134.622934-1-ak@linux.intel.com> <20240124193134.622934-4-ak@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Received-SPF: none client-ip=192.198.163.7; envelope-from=ak@linux.intel.com; helo=mgamail.intel.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9,DKIMWL_WL_HIGH=-1.5,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_EF=-0.1,SPF_HELO_NONE=0.001,SPF_NONE=0.001,T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Jan 25, 2024 at 08:08:23PM +0000, Joseph Myers wrote: > On Wed, 24 Jan 2024, Andi Kleen wrote: > > > Implement a C23 clang compatible musttail attribute similar to the earlier > > C++ implementation in the C parser. > > I'd expect diagnostics, and associated tests of those diagnostics, for: > > * musttail attribute used with any arguments, even empty > [[gnu::musttail()]], much like e.g. [[fallthrough()]] or > [[maybe_unused()]] gets diagnosed. These happen naturally because the attribute doesn't get removed when not in front of return, and it gets warned about like any other unknown attribute: tattr.c:5:9: warning: ‘musttail’ attribute ignored [-Wattributes] 5 | [[gnu::musttail]] i++; | ^ I don't have tests for that but since it's not new behavior I suppose that's sufficient. > For the first one of these, it may help to include the attribute in the > c_common_gnu_attributes table so the common attribute parsing code knows > that this one doesn't accept arguments (and with an attribute handler that > always rejects it on declarations, much like > handle_fallthrough_attribute). I just removed it there based on earlier feedback, which gives the intended "attribute is ignored" warning for these cases too. -Andi