aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2024-01-19 02:06:55 +0000
committerSandra Loosemore <sandra@codesourcery.com>2024-01-19 02:10:30 +0000
commited28a835058d2e72036f4adb1dd60edf735c7d00 (patch)
treec903fc161b7d15c757b7a49a59ac9110f8cf465e
parentbb0f96abb1b6bd80e90df71ce2632ce17844b0fd (diff)
downloadgcc-ed28a835058d2e72036f4adb1dd60edf735c7d00.zip
gcc-ed28a835058d2e72036f4adb1dd60edf735c7d00.tar.gz
gcc-ed28a835058d2e72036f4adb1dd60edf735c7d00.tar.bz2
More precise documentation for cleanup attribute [PR110029]
gcc/ChangeLog PR c/110029 * doc/extend.texi (Common Variable Attributes): Explain what happens when multiple variables with cleanups are in the same scope.
-rw-r--r--gcc/doc/extend.texi5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 616e26d..0bc586d 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