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 3267C3858022 for ; Fri, 26 Jan 2024 08:50:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3267C3858022 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3267C3858022 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=1706259015; cv=none; b=cy2FulmjY0ZvNQBnkxilYOsMif2ES5Y4F/nRNnV9KepwcTc/mu1Xusi8sTVq0ikS3ScgTG4ptNN/aM8xV0zzKTUuMTYDsMWJ6CCxEHXCkEm3kvBnauRS51ExyZbVAzlbxKG2Ryl/jPp4mdCx6Q9AVsIHe0Jtqe2g9J3/hi6G1qY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706259015; c=relaxed/simple; bh=v6uyFTDHbBHdbCKm/NB223RoS0P02XcyxOKQNqGI7t8=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=NmELj8lKPnBFjjUrvP/9vmdR6eleKiv0gLD6+1OYxN4gW9OQP5W6JWL5P1FFxbD7k8rgf2e1vsWAZCJ5bBdFqzl8WYxTieoeRw2T57+mlhkvVf0RUJt4/VV1AU7ESFnr7U7tXiwQurU00G9a1ntnoo2v2qH9aG4tf/DE0/VWHOQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rTHua-0005K9-QJ for gcc-patches@gnu.org; Fri, 26 Jan 2024 03:50:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706259008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=O/9CBrnSNuTVJ2BaIDUkQKjT1LssOXje2MgQZFk+DeY=; b=Hufj7XvQwY4FiO4SWp7LWnmbu0uOYKzaunY4bVL9YezRMnGc7VdlZXHK5qgRMba+aqf8oX o8BW/041ndX5oBt7Er2W/3FHKdFtzX9wcTbcNm54XALAYMTqbH8FIdpCHptfEyCJF/pIFN FWDpct21VdngVehS+UO+8PAOY/6mDGk= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-128-HAERYCW0NLyEqEgR5LQTNA-1; Fri, 26 Jan 2024 03:50:05 -0500 X-MC-Unique: HAERYCW0NLyEqEgR5LQTNA-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-337d70f889cso103295f8f.2 for ; Fri, 26 Jan 2024 00:50:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706259003; x=1706863803; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MXqSuBuaPyOou467L8q9umBEM/Q/fP77kjy8IdnV5Rg=; b=qikVTvoJgVXpMIzEpXnQrAMjAjRTArjKgbicUKgGFVB6eru5xfw+fV4JSq4xJKIgMF MOMMzlM5vkMOMZ9Uz1ELpjikJVAYULmVt/0w5/ffsFnZcpMfIaXF8X/fl3Ij61SZPprh DFTvWl689L45BIOrZF4eWH9q28Zyt7BRtV5vObpXg1B9Wz8MJ3vCZa5vtvY6Hx7kWJXk bVXeIgyODL0knoEUu2dhbvKo76dCiL9yvIWqclrX6gsrYaFzxylOE8MKe/Pi4iE/y/jo kWfYCdDKQiHv8Py2DiZly0578GVzFEcC2kQmTUi92X3rkeFiZuE+KsKvOFzghkx/XO4T Xdjw== X-Gm-Message-State: AOJu0YzVc6+G9Ri1ruSicOWDtSPytcQBdjYrS+S1s30Isg8Ar4j3kPDi R3utBrRqCgavARjMbdEOHEnQrFMiqvjlst5Q4AuROeZ7lpOLvxonQxNFQKCKpO1pean2Zg4XlJx HeaXDZYWpNSXyJcYqlPOc3UPJ2wj3sih4Cbzc6lfenhMMxQSE7nYhbSYONw== X-Received: by 2002:a5d:66c7:0:b0:336:f2a7:59b2 with SMTP id k7-20020a5d66c7000000b00336f2a759b2mr596798wrw.52.1706259003124; Fri, 26 Jan 2024 00:50:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPBr9TUX8mf2b5EIKDcQmLV0uQIJ6IJ6vTPo0Un2SDIX/UhVKxGpwB9Ioot0POZlccsZ2PNg== X-Received: by 2002:a5d:66c7:0:b0:336:f2a7:59b2 with SMTP id k7-20020a5d66c7000000b00336f2a759b2mr596790wrw.52.1706259002762; Fri, 26 Jan 2024 00:50:02 -0800 (PST) Received: from digraph.polyomino.org.uk (digraph.polyomino.org.uk. [2001:8b0:bf73:93f7::51bb:e332]) by smtp.gmail.com with ESMTPSA id c15-20020a5d63cf000000b00339273d0626sm766744wrw.84.2024.01.26.00.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 00:50:02 -0800 (PST) Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.95) (envelope-from ) id 1rTHtR-004ETe-1i; Fri, 26 Jan 2024 08:48:57 +0000 Date: Fri, 26 Jan 2024 08:48:57 +0000 (UTC) From: Joseph Myers To: Andi Kleen cc: gcc-patches@gnu.org Subject: Re: [PATCH v2 3/5] C: Implement musttail attribute for returns In-Reply-To: Message-ID: <92c0d9b2-95cc-f991-7868-872085766c50@redhat.com> References: <20240124193134.622934-1-ak@linux.intel.com> <20240124193134.622934-4-ak@linux.intel.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="-1152306461-128523514-1706258937=:1008846" Received-SPF: pass client-ip=170.10.133.124; envelope-from=josmyers@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9,DKIMWL_WL_HIGH=-1.5,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DKIM_VALID_EF=-0.1,RCVD_IN_DNSWL_NONE=-0.0001,RCVD_IN_MSPIKE_H3=0.001,RCVD_IN_MSPIKE_WL=0.001,SPF_HELO_NONE=0.001,SPF_PASS=-0.001,T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1152306461-128523514-1706258937=:1008846 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Thu, 25 Jan 2024, Andi Kleen wrote: > 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. Each attribute should have tests that invalid uses are appropriately diagnosed. See gcc.dg/c23-attr-fallthrough-2.c for examples of such tests in the case of the [[fallthrough]] attribute. Some invalid uses may be diagnosed by existing code that's generic across attributes, others require specific code for the individual attribute. The default parsing of an attribute without an entry in the table of attribute handlers is that arbitrary balanced token sequences are parsed and discarded as arguments. To diagnose such arguments (in contexts when the attribute is otherwise valid), an entry in the table of attribute handlers is appropriate. -- Joseph S. Myers josmyers@redhat.com ---1152306461-128523514-1706258937=:1008846--