2 Patch by Vitezslav Crhonek <vcrhonek@redhat.com>
3 Source: https://src.fedoraproject.org/rpms/texinfo/c/9b2cca4817fa4bd8d520fed05e9560fc7183dcdf?branch=rawhide
5 diff -up texinfo-6.8/gnulib/lib/cdefs.h.orig texinfo-6.8/gnulib/lib/cdefs.h
6 --- texinfo-6.8/gnulib/lib/cdefs.h.orig 2021-03-11 19:57:53.000000000 +0100
7 +++ texinfo-6.8/gnulib/lib/cdefs.h 2021-07-19 12:26:46.985176475 +0200
10 /* The nonnull function attribute marks pointer parameters that
12 -#ifndef __attribute_nonnull__
14 # if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__)
15 -# define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params))
16 +# define __nonnull(params) __attribute__ ((__nonnull__ params))
18 -# define __attribute_nonnull__(params)
19 +# define __nonnull(params)
23 -# define __nonnull(params) __attribute_nonnull__ (params)
24 +#elif !defined __GLIBC__
26 +# define __nonnull(params) _GL_ATTRIBUTE_NONNULL (params)
29 /* If fortification mode, we warn about unused results of certain
30 diff -up texinfo-6.8/gnulib/lib/libc-config.h.orig texinfo-6.8/gnulib/lib/libc-config.h
31 --- texinfo-6.8/gnulib/lib/libc-config.h.orig 2021-03-11 19:57:54.000000000 +0100
32 +++ texinfo-6.8/gnulib/lib/libc-config.h 2021-07-19 12:27:58.810590975 +0200
36 /* On glibc this includes <features.h> and <sys/cdefs.h> and #defines
37 - _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 and
38 - DragonFlyBSD 5.9 it includes <sys/cdefs.h> which defines __nonnull.
39 - Elsewhere it is harmless. */
40 + _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 it
41 + includes <sys/cdefs.h> which defines __nonnull. Elsewhere it
45 /* From glibc <errno.h>. */
46 diff -up texinfo-6.8/gnulib/lib/malloc/dynarray-skeleton.c.orig texinfo-6.8/gnulib/lib/malloc/dynarray-skeleton.c
47 --- texinfo-6.8/gnulib/lib/malloc/dynarray-skeleton.c.orig 2021-03-11 19:57:54.000000000 +0100
48 +++ texinfo-6.8/gnulib/lib/malloc/dynarray-skeleton.c 2021-07-19 12:24:46.878419397 +0200
49 @@ -192,7 +192,7 @@ DYNARRAY_NAME (free__array__) (struct DY
51 /* Initialize a dynamic array object. This must be called before any
53 -__attribute_nonnull__ ((1))
56 DYNARRAY_NAME (init) (struct DYNARRAY_STRUCT *list)
58 @@ -202,7 +202,7 @@ DYNARRAY_NAME (init) (struct DYNARRAY_ST
61 /* Deallocate the dynamic array and its elements. */
62 -__attribute_maybe_unused__ __attribute_nonnull__ ((1))
63 +__attribute_maybe_unused__ __nonnull ((1))
65 DYNARRAY_FREE (struct DYNARRAY_STRUCT *list)
67 @@ -213,7 +213,7 @@ DYNARRAY_FREE (struct DYNARRAY_STRUCT *l
70 /* Return true if the dynamic array is in an error state. */
71 -__attribute_nonnull__ ((1))
74 DYNARRAY_NAME (has_failed) (const struct DYNARRAY_STRUCT *list)
76 @@ -222,7 +222,7 @@ DYNARRAY_NAME (has_failed) (const struct
78 /* Mark the dynamic array as failed. All elements are deallocated as
80 -__attribute_nonnull__ ((1))
83 DYNARRAY_NAME (mark_failed) (struct DYNARRAY_STRUCT *list)
85 @@ -236,7 +236,7 @@ DYNARRAY_NAME (mark_failed) (struct DYNA
87 /* Return the number of elements which have been added to the dynamic
89 -__attribute_nonnull__ ((1))
92 DYNARRAY_NAME (size) (const struct DYNARRAY_STRUCT *list)
94 @@ -245,7 +245,7 @@ DYNARRAY_NAME (size) (const struct DYNAR
96 /* Return a pointer to the array element at INDEX. Terminate the
97 process if INDEX is out of bounds. */
98 -__attribute_nonnull__ ((1))
100 static inline DYNARRAY_ELEMENT *
101 DYNARRAY_NAME (at) (struct DYNARRAY_STRUCT *list, size_t index)
103 @@ -257,7 +257,7 @@ DYNARRAY_NAME (at) (struct DYNARRAY_STRU
104 /* Return a pointer to the first array element, if any. For a
105 zero-length array, the pointer can be NULL even though the dynamic
106 array has not entered the failure state. */
107 -__attribute_nonnull__ ((1))
109 static inline DYNARRAY_ELEMENT *
110 DYNARRAY_NAME (begin) (struct DYNARRAY_STRUCT *list)
112 @@ -267,7 +267,7 @@ DYNARRAY_NAME (begin) (struct DYNARRAY_S
113 /* Return a pointer one element past the last array element. For a
114 zero-length array, the pointer can be NULL even though the dynamic
115 array has not entered the failure state. */
116 -__attribute_nonnull__ ((1))
118 static inline DYNARRAY_ELEMENT *
119 DYNARRAY_NAME (end) (struct DYNARRAY_STRUCT *list)
121 @@ -294,7 +294,7 @@ DYNARRAY_NAME (add__) (struct DYNARRAY_S
122 /* Add ITEM at the end of the array, enlarging it by one element.
123 Mark *LIST as failed if the dynamic array allocation size cannot be
125 -__attribute_nonnull__ ((1))
128 DYNARRAY_NAME (add) (struct DYNARRAY_STRUCT *list, DYNARRAY_ELEMENT item)
130 @@ -348,8 +348,7 @@ DYNARRAY_NAME (emplace__) (struct DYNARR
131 /* Allocate a place for a new element in *LIST and return a pointer to
132 it. The pointer can be NULL if the dynamic array cannot be
133 enlarged due to a memory allocation failure. */
134 -__attribute_maybe_unused__ __attribute_warn_unused_result__
135 -__attribute_nonnull__ ((1))
136 +__attribute_maybe_unused__ __attribute_warn_unused_result__ __nonnull ((1))
138 /* Avoid inlining with the larger initialization code. */
139 #if !(defined (DYNARRAY_ELEMENT_INIT) || defined (DYNARRAY_ELEMENT_FREE))
140 @@ -373,7 +372,7 @@ DYNARRAY_NAME (emplace) (struct DYNARRAY
141 existing size, new elements are added (which can be initialized).
142 Otherwise, the list is truncated, and elements are freed. Return
143 false on memory allocation failure (and mark *LIST as failed). */
144 -__attribute_maybe_unused__ __attribute_nonnull__ ((1))
145 +__attribute_maybe_unused__ __nonnull ((1))
147 DYNARRAY_NAME (resize) (struct DYNARRAY_STRUCT *list, size_t size)
149 @@ -418,7 +417,7 @@ DYNARRAY_NAME (resize) (struct DYNARRAY_
152 /* Remove the last element of LIST if it is present. */
153 -__attribute_maybe_unused__ __attribute_nonnull__ ((1))
154 +__attribute_maybe_unused__ __nonnull ((1))
156 DYNARRAY_NAME (remove_last) (struct DYNARRAY_STRUCT *list)
158 @@ -435,7 +434,7 @@ DYNARRAY_NAME (remove_last) (struct DYNA
160 /* Remove all elements from the list. The elements are freed, but the
161 list itself is not. */
162 -__attribute_maybe_unused__ __attribute_nonnull__ ((1))
163 +__attribute_maybe_unused__ __nonnull ((1))
165 DYNARRAY_NAME (clear) (struct DYNARRAY_STRUCT *list)
167 @@ -453,8 +452,7 @@ DYNARRAY_NAME (clear) (struct DYNARRAY_S
168 stored in *RESULT if LIST refers to an empty list. On success, the
169 pointer in *RESULT is heap-allocated and must be deallocated using
171 -__attribute_maybe_unused__ __attribute_warn_unused_result__
172 -__attribute_nonnull__ ((1, 2))
173 +__attribute_maybe_unused__ __attribute_warn_unused_result__ __nonnull ((1, 2))
175 DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list,
176 DYNARRAY_FINAL_TYPE *result)
177 @@ -485,8 +483,7 @@ DYNARRAY_NAME (finalize) (struct DYNARRA
178 have a sentinel at the end). If LENGTHP is not NULL, the array
179 length is written to *LENGTHP. *LIST is re-initialized and can be
181 -__attribute_maybe_unused__ __attribute_warn_unused_result__
182 -__attribute_nonnull__ ((1))
183 +__attribute_maybe_unused__ __attribute_warn_unused_result__ __nonnull ((1))
184 static DYNARRAY_ELEMENT *
185 DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list, size_t *lengthp)