]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
More precise documentation for cleanup attribute [PR110029]
authorSandra Loosemore <sandra@codesourcery.com>
Fri, 19 Jan 2024 02:06:55 +0000 (02:06 +0000)
committerSandra Loosemore <sandra@codesourcery.com>
Fri, 19 Jan 2024 02:10:30 +0000 (02:10 +0000)
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

index 616e26d47dc2d556996a4037bb73c753209a4e03..0bc586d120e76238dc4e6452e93e6a1d12f20657 100644 (file)
@@ -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