Dash:
[t2-trunk.git] / package / base / texinfo / hotfix-glibc-2.34.patch
blob72f4048f2bf28fc739d27f82f055193c11eeb75b
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/texinfo/hotfix-glibc-2.34.patch
3 # Copyright (C) 2021 The T2 SDE Project
4 #
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
7 #
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
15 Patch by Vitezslav Crhonek <vcrhonek@redhat.com>
16 Source: https://src.fedoraproject.org/rpms/texinfo/c/9b2cca4817fa4bd8d520fed05e9560fc7183dcdf?branch=rawhide
18 diff -up texinfo-6.8/gnulib/lib/cdefs.h.orig texinfo-6.8/gnulib/lib/cdefs.h
19 --- texinfo-6.8/gnulib/lib/cdefs.h.orig 2021-03-11 19:57:53.000000000 +0100
20 +++ texinfo-6.8/gnulib/lib/cdefs.h 2021-07-19 12:26:46.985176475 +0200
21 @@ -321,15 +321,15 @@
23 /* The nonnull function attribute marks pointer parameters that
24 must not be NULL. */
25 -#ifndef __attribute_nonnull__
26 +#ifndef __nonnull
27 # if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__)
28 -# define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params))
29 +# define __nonnull(params) __attribute__ ((__nonnull__ params))
30 # else
31 -# define __attribute_nonnull__(params)
32 +# define __nonnull(params)
33 # endif
34 -#endif
35 -#ifndef __nonnull
36 -# define __nonnull(params) __attribute_nonnull__ (params)
37 +#elif !defined __GLIBC__
38 +# undef __nonnull
39 +# define __nonnull(params) _GL_ATTRIBUTE_NONNULL (params)
40 #endif
42 /* If fortification mode, we warn about unused results of certain
43 diff -up texinfo-6.8/gnulib/lib/libc-config.h.orig texinfo-6.8/gnulib/lib/libc-config.h
44 --- texinfo-6.8/gnulib/lib/libc-config.h.orig 2021-03-11 19:57:54.000000000 +0100
45 +++ texinfo-6.8/gnulib/lib/libc-config.h 2021-07-19 12:27:58.810590975 +0200
46 @@ -33,9 +33,9 @@
47 #include <config.h>
49 /* On glibc this includes <features.h> and <sys/cdefs.h> and #defines
50 - _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 and
51 - DragonFlyBSD 5.9 it includes <sys/cdefs.h> which defines __nonnull.
52 - Elsewhere it is harmless. */
53 + _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 it
54 + includes <sys/cdefs.h> which defines __nonnull. Elsewhere it
55 + is harmless. */
56 #include <errno.h>
58 /* From glibc <errno.h>. */
59 diff -up texinfo-6.8/gnulib/lib/malloc/dynarray-skeleton.c.orig texinfo-6.8/gnulib/lib/malloc/dynarray-skeleton.c
60 --- texinfo-6.8/gnulib/lib/malloc/dynarray-skeleton.c.orig 2021-03-11 19:57:54.000000000 +0100
61 +++ texinfo-6.8/gnulib/lib/malloc/dynarray-skeleton.c 2021-07-19 12:24:46.878419397 +0200
62 @@ -192,7 +192,7 @@ DYNARRAY_NAME (free__array__) (struct DY
64 /* Initialize a dynamic array object. This must be called before any
65 use of the object. */
66 -__attribute_nonnull__ ((1))
67 +__nonnull ((1))
68 static void
69 DYNARRAY_NAME (init) (struct DYNARRAY_STRUCT *list)
71 @@ -202,7 +202,7 @@ DYNARRAY_NAME (init) (struct DYNARRAY_ST
74 /* Deallocate the dynamic array and its elements. */
75 -__attribute_maybe_unused__ __attribute_nonnull__ ((1))
76 +__attribute_maybe_unused__ __nonnull ((1))
77 static void
78 DYNARRAY_FREE (struct DYNARRAY_STRUCT *list)
80 @@ -213,7 +213,7 @@ DYNARRAY_FREE (struct DYNARRAY_STRUCT *l
83 /* Return true if the dynamic array is in an error state. */
84 -__attribute_nonnull__ ((1))
85 +__nonnull ((1))
86 static inline bool
87 DYNARRAY_NAME (has_failed) (const struct DYNARRAY_STRUCT *list)
89 @@ -222,7 +222,7 @@ DYNARRAY_NAME (has_failed) (const struct
91 /* Mark the dynamic array as failed. All elements are deallocated as
92 a side effect. */
93 -__attribute_nonnull__ ((1))
94 +__nonnull ((1))
95 static void
96 DYNARRAY_NAME (mark_failed) (struct DYNARRAY_STRUCT *list)
98 @@ -236,7 +236,7 @@ DYNARRAY_NAME (mark_failed) (struct DYNA
100 /* Return the number of elements which have been added to the dynamic
101 array. */
102 -__attribute_nonnull__ ((1))
103 +__nonnull ((1))
104 static inline size_t
105 DYNARRAY_NAME (size) (const struct DYNARRAY_STRUCT *list)
107 @@ -245,7 +245,7 @@ DYNARRAY_NAME (size) (const struct DYNAR
109 /* Return a pointer to the array element at INDEX. Terminate the
110 process if INDEX is out of bounds. */
111 -__attribute_nonnull__ ((1))
112 +__nonnull ((1))
113 static inline DYNARRAY_ELEMENT *
114 DYNARRAY_NAME (at) (struct DYNARRAY_STRUCT *list, size_t index)
116 @@ -257,7 +257,7 @@ DYNARRAY_NAME (at) (struct DYNARRAY_STRU
117 /* Return a pointer to the first array element, if any. For a
118 zero-length array, the pointer can be NULL even though the dynamic
119 array has not entered the failure state. */
120 -__attribute_nonnull__ ((1))
121 +__nonnull ((1))
122 static inline DYNARRAY_ELEMENT *
123 DYNARRAY_NAME (begin) (struct DYNARRAY_STRUCT *list)
125 @@ -267,7 +267,7 @@ DYNARRAY_NAME (begin) (struct DYNARRAY_S
126 /* Return a pointer one element past the last array element. For a
127 zero-length array, the pointer can be NULL even though the dynamic
128 array has not entered the failure state. */
129 -__attribute_nonnull__ ((1))
130 +__nonnull ((1))
131 static inline DYNARRAY_ELEMENT *
132 DYNARRAY_NAME (end) (struct DYNARRAY_STRUCT *list)
134 @@ -294,7 +294,7 @@ DYNARRAY_NAME (add__) (struct DYNARRAY_S
135 /* Add ITEM at the end of the array, enlarging it by one element.
136 Mark *LIST as failed if the dynamic array allocation size cannot be
137 increased. */
138 -__attribute_nonnull__ ((1))
139 +__nonnull ((1))
140 static inline void
141 DYNARRAY_NAME (add) (struct DYNARRAY_STRUCT *list, DYNARRAY_ELEMENT item)
143 @@ -348,8 +348,7 @@ DYNARRAY_NAME (emplace__) (struct DYNARR
144 /* Allocate a place for a new element in *LIST and return a pointer to
145 it. The pointer can be NULL if the dynamic array cannot be
146 enlarged due to a memory allocation failure. */
147 -__attribute_maybe_unused__ __attribute_warn_unused_result__
148 -__attribute_nonnull__ ((1))
149 +__attribute_maybe_unused__ __attribute_warn_unused_result__ __nonnull ((1))
150 static
151 /* Avoid inlining with the larger initialization code. */
152 #if !(defined (DYNARRAY_ELEMENT_INIT) || defined (DYNARRAY_ELEMENT_FREE))
153 @@ -373,7 +372,7 @@ DYNARRAY_NAME (emplace) (struct DYNARRAY
154 existing size, new elements are added (which can be initialized).
155 Otherwise, the list is truncated, and elements are freed. Return
156 false on memory allocation failure (and mark *LIST as failed). */
157 -__attribute_maybe_unused__ __attribute_nonnull__ ((1))
158 +__attribute_maybe_unused__ __nonnull ((1))
159 static bool
160 DYNARRAY_NAME (resize) (struct DYNARRAY_STRUCT *list, size_t size)
162 @@ -418,7 +417,7 @@ DYNARRAY_NAME (resize) (struct DYNARRAY_
165 /* Remove the last element of LIST if it is present. */
166 -__attribute_maybe_unused__ __attribute_nonnull__ ((1))
167 +__attribute_maybe_unused__ __nonnull ((1))
168 static void
169 DYNARRAY_NAME (remove_last) (struct DYNARRAY_STRUCT *list)
171 @@ -435,7 +434,7 @@ DYNARRAY_NAME (remove_last) (struct DYNA
173 /* Remove all elements from the list. The elements are freed, but the
174 list itself is not. */
175 -__attribute_maybe_unused__ __attribute_nonnull__ ((1))
176 +__attribute_maybe_unused__ __nonnull ((1))
177 static void
178 DYNARRAY_NAME (clear) (struct DYNARRAY_STRUCT *list)
180 @@ -453,8 +452,7 @@ DYNARRAY_NAME (clear) (struct DYNARRAY_S
181 stored in *RESULT if LIST refers to an empty list. On success, the
182 pointer in *RESULT is heap-allocated and must be deallocated using
183 free. */
184 -__attribute_maybe_unused__ __attribute_warn_unused_result__
185 -__attribute_nonnull__ ((1, 2))
186 +__attribute_maybe_unused__ __attribute_warn_unused_result__ __nonnull ((1, 2))
187 static bool
188 DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list,
189 DYNARRAY_FINAL_TYPE *result)
190 @@ -485,8 +483,7 @@ DYNARRAY_NAME (finalize) (struct DYNARRA
191 have a sentinel at the end). If LENGTHP is not NULL, the array
192 length is written to *LENGTHP. *LIST is re-initialized and can be
193 reused. */
194 -__attribute_maybe_unused__ __attribute_warn_unused_result__
195 -__attribute_nonnull__ ((1))
196 +__attribute_maybe_unused__ __attribute_warn_unused_result__ __nonnull ((1))
197 static DYNARRAY_ELEMENT *
198 DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list, size_t *lengthp)