snippet/warn-on-use: Add comment.
authorBruno Haible <bruno@clisp.org>
Mon, 5 Feb 2024 14:02:21 +0000 (15:02 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 5 Feb 2024 14:02:21 +0000 (15:02 +0100)
* lib/warn-on-use.h: Document a restriction of _GL_WARN_ON_USE.

ChangeLog
lib/warn-on-use.h

index 5246105f57fe33944dd79159f9f08f98814799c8..88f92c9609d48c18e43939068de9dee57e4a3c40 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-02-05  Bruno Haible  <bruno@clisp.org>
+
+       snippet/warn-on-use: Add comment.
+       * lib/warn-on-use.h: Document a restriction of _GL_WARN_ON_USE.
+
 2024-02-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        xalloc-oversized: omit unnecessary cast
index 8f4d40dcbebdef9ff00d64d988396745836f59b6..701013a07f4522ce44c6f778eee7e1d57a79321d 100644 (file)
    _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
    linkage.
 
+   _GL_WARN_ON_USE should not be used more than once for a given function
+   in a given compilation unit (because this may generate a warning even
+   if the function is never called).
+
    However, one of the reasons that a function is a portability trap is
    if it has the wrong signature.  Declaring FUNCTION with a different
    signature in C is a compilation error, so this macro must use the