From: Bruno Haible Date: Sun, 9 Feb 2025 21:02:14 +0000 (+0100) Subject: xstring-desc: Allow for better static analysis. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=a98db2f436eade23a4626892b9c3dcd50f298472;p=gnulib.git xstring-desc: Allow for better static analysis. * lib/xstring-desc.h (xsd_c): Declare a non-NULL return value. --- diff --git a/ChangeLog b/ChangeLog index 0310e40fed..1ab751f289 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-02-09 Bruno Haible + + xstring-desc: Allow for better static analysis. + * lib/xstring-desc.h (xsd_c): Declare a non-NULL return value. + 2025-02-09 Bruno Haible mbsstr, mbscasestr, mbspcasecmp, unistr, unigbrk: Simplify. diff --git a/lib/xstring-desc.h b/lib/xstring-desc.h index 7957795d98..20b3e72a18 100644 --- a/lib/xstring-desc.h +++ b/lib/xstring-desc.h @@ -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) {