Hi,

Just noticed the WG14 paper
<https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3424.htm>.
It means that we need to hold our breath before recommending to use
the REPRODUCIBLE or UNSEQUENCED attributes, because the meanings of
these attributes may still change.

Also noteworthy is that in section 1 of this paper, the motivation
is to make REPRODUCIBLE equivalent to PURE, and UNSEQUENCED equivalent to CONST,
but the proposed changes in section 3 address only one of the two differences
between REPRODUCIBLE/UNSEQUENCED and PURE/CONST. Even with the proposed change,
  - A function with UNSEQUENCED can depend on the state addressed by its
    arguments, while a function with CONST cannot.
  - A function with REPRODUCIBLE can affect state addressed by its arguments,
    while a function with PURE cannot.


2025-01-19  Bruno Haible  <br...@clisp.org>

        attribute: Add note about ongoing standardization of some attributes.
        * m4/gnulib-common.m4 (gl_COMMON_BODY): Add note that the meaning of
        _GL_ATTRIBUTE_REPRODUCIBLE and _GL_ATTRIBUTE_UNSEQUENCED are likely to
        change.
        * lib/attribute.h (UNSEQUENCED, REPRODUCIBLE): Likewise.

diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index b3b1391bd5..6eff85bea1 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
 # gnulib-common.m4
-# serial 106
+# serial 107
 dnl Copyright (C) 2007-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -753,7 +753,9 @@ AC_DEFUN([gl_COMMON_BODY]
    than _GL_ATTRIBUTE_PURE because the function need not return
    exactly once and can affect state addressed by its arguments.)
    See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and
-   <https://stackoverflow.com/questions/76847905/>.  */
+   <https://stackoverflow.com/questions/76847905/>.
+   ATTENTION! Efforts are underway to change the meaning of this attribute.
+   See <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3424.htm>.  */
 /* Applies to: functions, pointer to functions, function types.  */
 #ifndef _GL_ATTRIBUTE_REPRODUCIBLE
 /* This may be revisited when gcc and clang support [[reproducible]] or 
possibly
@@ -804,7 +806,9 @@ AC_DEFUN([gl_COMMON_BODY]
    _GL_ATTRIBUTE_CONST because the function need not return exactly
    once and can depend on state addressed by its arguments.)
    See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and
-   <https://stackoverflow.com/questions/76847905/>.  */
+   <https://stackoverflow.com/questions/76847905/>.
+   ATTENTION! Efforts are underway to change the meaning of this attribute.
+   See <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3424.htm>.  */
 /* Applies to: functions, pointer to functions, function types.  */
 #ifndef _GL_ATTRIBUTE_UNSEQUENCED
 /* This may be revisited when gcc and clang support [[unsequenced]] or possibly
diff --git a/lib/attribute.h b/lib/attribute.h
index 4939d776e7..625195c856 100644
--- a/lib/attribute.h
+++ b/lib/attribute.h
@@ -257,7 +257,9 @@
    because the function need not return exactly once and can depend
    on state addressed by its arguments.)
    See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and
-   <https://stackoverflow.com/questions/76847905/>.  */
+   <https://stackoverflow.com/questions/76847905/>.
+   ATTENTION! Efforts are underway to change the meaning of this attribute.
+   See <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3424.htm>.  */
 /* Applies to: functions, pointer to functions, function type.  */
 #define UNSEQUENCED _GL_ATTRIBUTE_UNSEQUENCED

@@ -284,7 +286,9 @@
    because the function need not return exactly once and can affect
    state addressed by its arguments.)
    See also <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm> and
-   <https://stackoverflow.com/questions/76847905/>.  */
+   <https://stackoverflow.com/questions/76847905/>.
+   ATTENTION! Efforts are underway to change the meaning of this attribute.
+   See <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3424.htm>.  */
 /* Applies to: functions, pointer to functions, function type.  */
 #define REPRODUCIBLE _GL_ATTRIBUTE_REPRODUCIBLE





Reply via email to