]> Savannah Git Hosting - gnulib.git/commitdiff
wctype, wctrans: Require a non-NULL argument.
authorBruno Haible <bruno@clisp.org>
Wed, 26 Jul 2023 11:40:06 +0000 (13:40 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 26 Jul 2023 11:40:06 +0000 (13:40 +0200)
* lib/wctype.in.h: Add placeholder for definition of _GL_ARG_NONNULL.
(wctype, wctrans): Mark with _GL_ARG_NONNULL ((1)).
* modules/wctype-h (Depends-on): Add snippet/arg-nonnull.
(Makefile.am): Substitute $(ARG_NONNULL_H) into wctype.h.

ChangeLog
lib/wctype.in.h
modules/wctype-h

index 32ffeea69dadeed80b04e27faee71dd67115f999..e3d2ce44ee6525ede54149e4903a70c20514f690 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-07-26  Bruno Haible  <bruno@clisp.org>
+
+       wctype, wctrans: Require a non-NULL argument.
+       * lib/wctype.in.h: Add placeholder for definition of _GL_ARG_NONNULL.
+       (wctype, wctrans): Mark with _GL_ARG_NONNULL ((1)).
+       * modules/wctype-h (Depends-on): Add snippet/arg-nonnull.
+       (Makefile.am): Substitute $(ARG_NONNULL_H) into wctype.h.
+
 2023-07-25  Bruno Haible  <bruno@clisp.org>
 
        iswctype: Add tests.
index 227fdac24bfc0a89f2310db4ac35600d2e499d3f..926a78d62186175f744679f1bd22202b67f817fe 100644 (file)
@@ -81,6 +81,8 @@ _GL_INLINE_HEADER_BEGIN
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
 /* Solaris 2.6 <wctype.h> includes <widec.h> which includes <euc.h> which
@@ -631,7 +633,8 @@ typedef void * wctype_t;
 /* Get a descriptor for a wide character property.  */
 #if @GNULIB_WCTYPE@
 # if !@HAVE_WCTYPE_T@
-_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name));
+_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name)
+                                    _GL_ARG_NONNULL ((1)));
 # endif
 _GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
 # if __GLIBC__ >= 2
@@ -695,7 +698,8 @@ typedef void * wctrans_t;
 /* Get a descriptor for a wide character case conversion.  */
 #if @GNULIB_WCTRANS@
 # if !@HAVE_WCTRANS_T@
-_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name));
+_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name)
+                                      _GL_ARG_NONNULL ((1)));
 # endif
 _GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
 # if __GLIBC__ >= 2
index 2d0392a9c690beb72f56ef3f2e2bb81c3129c66b..d5cc890aeec79fa720952f07f445ae99b283e389 100644 (file)
@@ -11,6 +11,7 @@ Depends-on:
 extern-inline
 gen-header
 include_next
+snippet/arg-nonnull
 snippet/c++defs
 snippet/warn-on-use
 
@@ -25,7 +26,7 @@ lib_SOURCES += wctype-h.c
 
 # We need the following in order to create <wctype.h> when the system
 # doesn't have one that works with the given compiler.
-wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
 @NMD@  $(AM_V_GEN)$(MKDIR_P) '%reldir%'
        $(gl_V_at)$(SED_HEADER_STDOUT) \
              -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -54,6 +55,7 @@ wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H
              -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
              -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              $(srcdir)/wctype.in.h > $@-t
        $(AM_V_at)mv $@-t $@