]> Savannah Git Hosting - gnulib.git/commitdiff
xstring-desc: Allow for better static analysis.
authorBruno Haible <bruno@clisp.org>
Sun, 9 Feb 2025 21:02:14 +0000 (22:02 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 9 Feb 2025 21:02:14 +0000 (22:02 +0100)
* lib/xstring-desc.h (xsd_c): Declare a non-NULL return value.

ChangeLog
lib/xstring-desc.h

index 0310e40fed6ded4bd41c6ec0520d63d3de1bf6f6..1ab751f289afc4672d26e2c1f3cf5e2d74666e49 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-02-09  Bruno Haible  <bruno@clisp.org>
+
+       xstring-desc: Allow for better static analysis.
+       * lib/xstring-desc.h (xsd_c): Declare a non-NULL return value.
+
 2025-02-09  Bruno Haible  <bruno@clisp.org>
 
        mbsstr, mbscasestr, mbspcasecmp, unistr, unigbrk: Simplify.
index 7957795d9853614133ea63f6635d7f74784f7163..20b3e72a184958c3998b90e910b81c325873a01f 100644 (file)
@@ -19,7 +19,8 @@
 #ifndef _XSTRING_DESC_H
 #define _XSTRING_DESC_H 1
 
-/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE.  */
+/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE,
+   _GL_ATTRIBUTE_DEALLOC_FREE, _GL_ATTRIBUTE_RETURNS_NONNULL.  */
 #if !_GL_CONFIG_H_INCLUDED
  #error "Please include config.h first."
 #endif
@@ -95,7 +96,7 @@ xsd_copy (string_desc_t s)
 }
 
 GL_XSTRING_DESC_INLINE
-_GL_ATTRIBUTE_DEALLOC_FREE
+_GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_RETURNS_NONNULL
 char *
 xsd_c (string_desc_t s)
 {