From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 3AEA83858D1E for ; Fri, 19 Jan 2024 02:12:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3AEA83858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3AEA83858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.180 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705630335; cv=none; b=uOmsB3dC27Pyd9VcEDm2z6tW6OGroc4AGG+vbzZ2yuxuFRabY0OjUk/YfZVXX0MnQqOsN5j4tVqQAUUGp1td3Y+lfbVeGPu6SlTrb9LzMBJwoEKIJVNGFsSCKbXbb2jQsPWR1CS6LbgVRaUDt28HS8LEsQD350SUYKG95D/U2C4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705630335; c=relaxed/simple; bh=hTbGDGSXVl9UpZixnFiGZC7T4D/M0iWCwdb7jc/OZUQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=iAAR6aRHKCuhcmO3KOHGtbspygwGmCy55PbNkXVF/45BaByxeRVrOjenhTKPSuKbOU3JJA8DYr27u1MZVQ5hq2ASD4jo2EVRa3meqSib4Uodj1e8rWhh0Hc8eMu5QssbaG7UUjTsOGTyvX5JPXPlYVdp42RmqmDxqtrdyWmfab8= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: hjLUAdBXS5C3suJZmViWkQ== X-CSE-MsgGUID: u8GC7ZG4TFi6SBNHTZez0g== X-IronPort-AV: E=Sophos;i="6.05,203,1701158400"; d="scan'208";a="28367762" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 18 Jan 2024 18:12:06 -0800 IronPort-SDR: nh0qK6gXSUQzrzCCIVJl9PTvKzCbT21vBXYu56FzC9ZdHdhfkbsXr+bnKYy0FJcljqAsGzEZrl UjBTyxf3RCbSaDHWTALZnen8uO+0I4c35XwT28ACvuS4Fjkx+IEoMWNWhRCO2leisJjdGQkHpx AC/rw2VHeUvYK9uQarmoQN+QXTxWvUAJACjR7ZSTIYrhKu4XmPvw/P3ThweNOA46kcUPd6mEcZ nZhMA251Ftus1+aWPkN6YV6UaAtW7ikWCv0DUFtpTbA0jnyiOUObNkGYyoDwM+f8bRQ/diqnvf 08A= From: Sandra Loosemore To: Subject: [COMMITTED] More precise documentation for cleanup attribute [PR110029] Date: Thu, 18 Jan 2024 19:11:51 -0700 Message-ID: <20240119021151.2801615-1-sandra@codesourcery.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: svr-orw-mbx-14.mgc.mentorg.com (147.34.90.214) To svr-orw-mbx-13.mgc.mentorg.com (147.34.90.213) X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,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: gcc/ChangeLog PR c/110029 * doc/extend.texi (Common Variable Attributes): Explain what happens when multiple variables with cleanups are in the same scope. --- gcc/doc/extend.texi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 616e26d47dc..0bc586d120e 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -7782,6 +7782,11 @@ with static storage duration. The function must take one parameter, a pointer to a type compatible with the variable. The return value of the function (if any) is ignored. +When multiple variables in the same scope have @code{cleanup} +attributes, at exit from the scope their associated cleanup functions +are run in reverse order of definition (last defined, first +cleanup). + If @option{-fexceptions} is enabled, then @var{cleanup_function} is run during the stack unwinding that happens during the processing of the exception. Note that the @code{cleanup} attribute -- 2.31.1