public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-3155] extend.texi: add note about reserved ctor/dtor priorities
@ 2021-08-26  1:31 Jonathan Yong
  0 siblings, 0 replies; only message in thread
From: Jonathan Yong @ 2021-08-26  1:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d4b782985b4adb86ebcccff697366136321d45b2

commit r12-3155-gd4b782985b4adb86ebcccff697366136321d45b2
Author: Jonathan Yong <10walls@gmail.com>
Date:   Wed Aug 25 16:36:14 2021 +0000

    extend.texi: add note about reserved ctor/dtor priorities
    
    gcc/Changelog:
    
            * doc/extend.texi: Add note about reserved priorities
            to the constructor attribute.
    
    Signed-off-by: Jonathan Yong <10walls@gmail.com>

Diff:
---
 gcc/doc/extend.texi | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 49df8e6dc38..251a10302b4 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2787,16 +2787,16 @@ On some targets the attributes also accept an integer argument to
 specify a priority to control the order in which constructor and
 destructor functions are run.  A constructor
 with a smaller priority number runs before a constructor with a larger
-priority number; the opposite relationship holds for destructors.  So,
-if you have a constructor that allocates a resource and a destructor
-that deallocates the same resource, both functions typically have the
-same priority.  The priorities for constructor and destructor
-functions are the same as those specified for namespace-scope C++
-objects (@pxref{C++ Attributes}).  However, at present, the order in which
-constructors for C++ objects with static storage duration and functions
-decorated with attribute @code{constructor} are invoked is unspecified.
-In mixed declarations, attribute @code{init_priority} can be used to
-impose a specific ordering.
+priority number; the opposite relationship holds for destructors.  Note
+that priorities 0-100 are reserved.  So, if you have a constructor that
+allocates a resource and a destructor that deallocates the same
+resource, both functions typically have the same priority.  The
+priorities for constructor and destructor functions are the same as
+those specified for namespace-scope C++ objects (@pxref{C++ Attributes}).
+However, at present, the order in which constructors for C++ objects
+with static storage duration and functions decorated with attribute
+@code{constructor} are invoked is unspecified. In mixed declarations,
+attribute @code{init_priority} can be used to impose a specific ordering.
 
 Using the argument forms of the @code{constructor} and @code{destructor}
 attributes on targets where the feature is not supported is rejected with


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-26  1:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26  1:31 [gcc r12-3155] extend.texi: add note about reserved ctor/dtor priorities Jonathan Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).