Three small doc patches:

2024-12-30  Bruno Haible  <br...@clisp.org>

        doc: Revisit some index entries.
        * doc/attribute.texi: Refer to the 'attribute' module.
        * doc/verify.texi: Refer to the 'verify' module.
        * doc/noreturn.texi: Remove duplicate index entries.

2024-12-30  Bruno Haible  <br...@clisp.org>

        doc: Document the 'inline' module.
        * doc/static-inline.texi: Document the 'inline' module.
        * m4/inline.m4: Fix comment.

2024-12-30  Bruno Haible  <br...@clisp.org>

        signal: Deprecate old stub module.
        * modules/signal: Mark as deprecated.

>From 7ae8c40c3a9659c1c7668e462a3bf2c098843359 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Mon, 30 Dec 2024 11:16:27 +0100
Subject: [PATCH 1/3] signal: Deprecate old stub module.

* modules/signal: Mark as deprecated.
---
 ChangeLog      |  5 +++++
 modules/signal | 10 ++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 011eb953d0..89efd2834d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-12-30  Bruno Haible  <br...@clisp.org>
+
+	signal: Deprecate old stub module.
+	* modules/signal: Mark as deprecated.
+
 2024-12-29  Bruno Haible  <br...@clisp.org>
 
 	qsort_r: Update documentation.
diff --git a/modules/signal b/modules/signal
index 9885a112e8..8d94bf5ad0 100644
--- a/modules/signal
+++ b/modules/signal
@@ -1,5 +1,11 @@
 Description:
-Placeholder for eventual signal() replacement.
+A GNU-like <signal.h>.
+
+Status:
+deprecated
+
+Notice:
+This module is deprecated. Use the module 'signal-h' instead.
 
 Files:
 
@@ -11,9 +17,9 @@ configure.ac:
 Makefile.am:
 
 Include:
+<signal.h>
 
 License:
 LGPLv2+
 
 Maintainer:
-all
-- 
2.43.0

>From cd2d160f3973841f583da83bdd875bbadedce835 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Mon, 30 Dec 2024 15:17:42 +0100
Subject: [PATCH 2/3] doc: Document the 'inline' module.

* doc/static-inline.texi: Document the 'inline' module.
* m4/inline.m4: Fix comment.
---
 ChangeLog              |  6 ++++++
 doc/static-inline.texi | 21 ++++++++++++++++++---
 m4/inline.m4           |  6 ++++--
 3 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 89efd2834d..bacd26e18f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-12-30  Bruno Haible  <br...@clisp.org>
+
+	doc: Document the 'inline' module.
+	* doc/static-inline.texi: Document the 'inline' module.
+	* m4/inline.m4: Fix comment.
+
 2024-12-30  Bruno Haible  <br...@clisp.org>
 
 	signal: Deprecate old stub module.
diff --git a/doc/static-inline.texi b/doc/static-inline.texi
index 5faf4f252d..9e12750384 100644
--- a/doc/static-inline.texi
+++ b/doc/static-inline.texi
@@ -1,4 +1,4 @@
-@c GNU static-inline module documentation
+@c Documentation of gnulib module 'inline'.
 
 @c Copyright (C) 2019--2024 Free Software Foundation, Inc.
 
@@ -14,6 +14,21 @@
 @cindex static inline
 @cindex inline
 
-In order to mark functions as @code{static inline}, the only
-prerequisite you need is an @code{AC_REQUIRE([AC_C_INLINE])}.
+In order to mark functions as @code{static inline} in @code{.c} files,
+the only prerequisite you need is an @code{AC_REQUIRE([AC_C_INLINE])}.
 No Gnulib module is needed.
+
+@mindex inline
+When marking functions as @code{static inline} in @code{.h} files,
+on the other hand,
+it is useful to avoid the following problem:
+When gcc or clang is not optimizing, it generates the same object code
+for every @code{static inline} function
+that is actually used in the current compilation unit,
+thus bloating the size of the resulting binary.
+(Code of @code{static inline} functions
+that are unused in the current compilation unit gets dropped;
+that is not an issue.)
+To avoid this problem, use the Gnulib module @samp{inline}
+and make the @code{static inline} function definition conditional
+on the value of the C macro @code{HAVE_INLINE}.
diff --git a/m4/inline.m4 b/m4/inline.m4
index fe4c0e7147..c002bc64a3 100644
--- a/m4/inline.m4
+++ b/m4/inline.m4
@@ -1,5 +1,5 @@
 # inline.m4
-# serial 4
+# serial 5
 dnl Copyright (C) 2006, 2009-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,7 +10,9 @@
 dnl Define 'inline' to a supported equivalent, or to nothing if not supported,
 dnl like AC_C_INLINE does.  Also, define HAVE_INLINE if 'inline' or an
 dnl equivalent is effectively supported, i.e. if the compiler is likely to
-dnl drop unused 'static inline' functions.
+dnl actually inline 'static inline' functions when there are used.  (All
+dnl versions of gcc and clang actually drop the code of 'static inline'
+dnl functions that are unused in the current compilation unit.)
 AC_DEFUN([gl_INLINE],
 [
   AC_REQUIRE([AC_C_INLINE])
-- 
2.43.0

>From c08abe38ebc2cfd8e0901230f48374d632e95868 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Mon, 30 Dec 2024 15:38:51 +0100
Subject: [PATCH 3/3] doc: Revisit some index entries.

* doc/attribute.texi: Refer to the 'attribute' module.
* doc/verify.texi: Refer to the 'verify' module.
* doc/noreturn.texi: Remove duplicate index entries.
---
 ChangeLog          | 7 +++++++
 doc/attribute.texi | 6 +++---
 doc/noreturn.texi  | 6 ++----
 doc/verify.texi    | 4 ++--
 4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bacd26e18f..eb0b79996a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-12-30  Bruno Haible  <br...@clisp.org>
+
+	doc: Revisit some index entries.
+	* doc/attribute.texi: Refer to the 'attribute' module.
+	* doc/verify.texi: Refer to the 'verify' module.
+	* doc/noreturn.texi: Remove duplicate index entries.
+
 2024-12-30  Bruno Haible  <br...@clisp.org>
 
 	doc: Document the 'inline' module.
diff --git a/doc/attribute.texi b/doc/attribute.texi
index 8895eb3a4e..fb6ae59ff1 100644
--- a/doc/attribute.texi
+++ b/doc/attribute.texi
@@ -13,9 +13,9 @@
 
 @cindex Attributes
 @findex __attribute__
-
-This module provides a header file @file{attribute.h} that defines
-macros related to C and C++ attributes and the GCC
+@mindex attribute
+The module @samp{attribute} provides a header file @file{attribute.h} that
+defines macros related to C and C++ attributes and the GCC
 @code{__attribute__} keyword.
 
 Here is an example of its use:
diff --git a/doc/noreturn.texi b/doc/noreturn.texi
index 06bc791621..659eef8acb 100644
--- a/doc/noreturn.texi
+++ b/doc/noreturn.texi
@@ -1,4 +1,4 @@
-@c GNU noreturn, stdnoreturn modules documentation
+@c GNU noreturn, stdnoreturn-h modules documentation
 
 @c Copyright (C) 2019--2024 Free Software Foundation, Inc.
 
@@ -11,9 +11,6 @@
 @node Non-returning Functions
 @section Non-returning Functions
 
-@cindex @code{_Noreturn}
-@mindex @code{noreturn}
-@mindex @code{stdnoreturn-h}
 A "non-returning" function is a function which cannot return normally.
 Instead of returning, it can loop forever, or it can transfer control via
 @code{abort}, @code{execvp}, @code{exit}, @code{longjmp}, @code{throw}
@@ -29,6 +26,7 @@
 
 @itemize @bullet
 @item
+@cindex @code{_Noreturn}
 The @code{_Noreturn} keyword.  No modules are needed, as Gnulib
 arranges for @code{<config.h>} to define @code{_Noreturn} to an
 appropriate replacement on platforms lacking it.
diff --git a/doc/verify.texi b/doc/verify.texi
index 40fc459972..99b9e37fa8 100644
--- a/doc/verify.texi
+++ b/doc/verify.texi
@@ -14,8 +14,8 @@
 @cindex assertion
 @findex verify
 @findex verify_expr
-
-This module provides a header file @file{verify.h} that defines
+@mindex verify
+The module @samp{verify} provides a header file @file{verify.h} that defines
 macros related to compile-time verification.
 
 Two of these macros are @code{verify (@var{V})} and @code{verify_expr
-- 
2.43.0

Reply via email to