This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
RE: [perl #26136] localtime(3) calls tzset(3), but localtime_r(3) may not.
[metaconfig.git] / U / modified / d_attribut.U
1 ?RCS: $Id: d_attribut.U,v 3.0.1.3 1995/01/30 14:33:45 ram Exp $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
4 ?RCS: 
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
10 ?RCS:
11 ?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
12 ?RCS:
13 ?RCS: $Log: d_attribut.U,v $
14 ?RCS: Revision 3.0.1.3  1995/01/30  14:33:45  ram
15 ?RCS: patch49: test C program now includes <stdio.h> (WED)
16 ?RCS:
17 ?RCS: Revision 3.0.1.2  1995/01/11  15:25:47  ram
18 ?RCS: patch45: fixed typo in the d_attribut variable (ADO)
19 ?RCS:
20 ?RCS: Revision 3.0.1.1  1994/10/29  16:08:55  ram
21 ?RCS: patch36: created by ADO
22 ?RCS:
23 ?MAKE:d_attribute_format d_attribute_malloc d_attribute_nonnull d_attribute_noreturn d_attribute_pure d_attribute_unused d_attribute_warn_unused_result: Myread Oldconfig cat cc ccflags rm Setvar contains
24 ?MAKE:  -pick add $@ %<
25 ?S:d_attribute_format (d_attribut_format.U):
26 ?S:     This variable conditionally defines HASATTRIBUTE_FORMAT, which
27 ?S:     indicates the C compiler can check for printf-like formats.
28 ?S:.
29 ?S:d_attribute_malloc (d_attribute_malloc.U):
30 ?S:     This variable conditionally defines HASATTRIBUTE_MALLOC, which
31 ?S:     indicates the C compiler can understand functions as having
32 ?S:     malloc-like semantics.
33 ?S:.
34 ?S:d_attribute_nonnull (d_attribute_nonnull.U):
35 ?S:     This variable conditionally defines HASATTRIBUTE_NONNULL, which
36 ?S:     indicates that the C compiler can know that certain arguments
37 ?S:     must not be NULL, and will check accordingly at compile time.
38 ?S:.
39 ?S:d_attribute_noreturn (d_attribute_noreturn.U):
40 ?S:     This variable conditionally defines HASATTRIBUTE_NORETURN, which
41 ?S:     indicates that the C compiler can know that certain functions
42 ?S:     are guaranteed never to return.
43 ?S:.
44 ?S:d_attribute_pure (d_attribute_pure.U):
45 ?S:     This variable conditionally defines HASATTRIBUTE_PURE, which
46 ?S:     indicates that the C compiler can know that certain functions
47 ?S:     are "pure" functions, meaning that they have no side effects, and
48 ?S:     only rely on function input and/or global data for their results.
49 ?S:.
50 ?S:d_attribute_unused (d_attribute_unused.U):
51 ?S:     This variable conditionally defines HASATTRIBUTE_UNUSED, which
52 ?S:     indicates that the C compiler can know that certain variables
53 ?S:     and arguments may not always be used, and to not throw warnings
54 ?S:     if they don't get used.
55 ?S:.
56 ?S:d_attribute_warn_unused_result (d_attribute_warn_unused_result.U):
57 ?S:     This variable conditionally defines
58 ?S:     HASATTRIBUTE_WARN_UNUSED_RESULT, which indicates that the C
59 ?S:     compiler can know that certain functions have a return values
60 ?S:     that must not be ignored, such as malloc() or open().
61 ?S:.
62 ?C:HASATTRIBUTE_FORMAT ~ %< (GNUC_ATTRIBUTE_CHECK):
63 ?C:     Can we handle GCC attribute for checking printf-style formats
64 ?C:.
65 ?C:HASATTRIBUTE_MALLOC:
66 ?C:     Can we handle GCC attribute for malloc-style functions.
67 ?C:.
68 ?C:HASATTRIBUTE_NONNULL:
69 ?C:     Can we handle GCC attribute for nonnull function parms.
70 ?C:.
71 ?C:HASATTRIBUTE_NORETURN:
72 ?C:     Can we handle GCC attribute for functions that do not return
73 ?C:.
74 ?C:HASATTRIBUTE_PURE:
75 ?C:     Can we handle GCC attribute for pure functions
76 ?C:.
77 ?C:HASATTRIBUTE_UNUSED:
78 ?C:     Can we handle GCC attribute for unused variables and arguments
79 ?C:.
80 ?C:HASATTRIBUTE_WARN_UNUSED_RESULT ~ %< (HASATTRIBUTE):
81 ?C:     Can we handle GCC attribute for warning on unused results
82 ?C:.
83 ?H:?%<:#$d_attribute_format HASATTRIBUTE_FORMAT /**/
84 ?H:?%<:#$d_attribute_noreturn HASATTRIBUTE_NORETURN     /**/
85 ?H:?%<:#$d_attribute_malloc HASATTRIBUTE_MALLOC /**/
86 ?H:?%<:#$d_attribute_nonnull HASATTRIBUTE_NONNULL       /**/
87 ?H:?%<:#$d_attribute_pure HASATTRIBUTE_PURE     /**/
88 ?H:?%<:#$d_attribute_unused HASATTRIBUTE_UNUSED /**/
89 ?H:?%<:#$d_attribute_warn_unused_result HASATTRIBUTE_WARN_UNUSED_RESULT /**/
90 ?H:.
91 ?LINT:set d_attribute_format
92 ?LINT:set d_attribute_malloc
93 ?LINT:set d_attribute_nonnull
94 ?LINT:set d_attribute_noreturn
95 ?LINT:set d_attribute_pure
96 ?LINT:set d_attribute_unused
97 ?LINT:set d_attribute_warn_unused_result
98 : Look for GCC-style attribute format
99 case "$d_attribute_format" in
100 '')
101 echo " "
102 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
103 $cat >attrib.c <<'EOCP'
104 #include <stdio.h>
105 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
106 EOCP
107 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
108         if $contains 'warning' attrib.out >/dev/null 2>&1; then
109                 echo "Your C compiler doesn't support __attribute__((format))."
110                 val="$undef"
111         else
112                 echo "Your C compiler supports __attribute__((format))."
113                 val="$define"
114         fi
115 else
116         echo "Your C compiler doesn't seem to understand __attribute__ at all."
117         val="$undef"
118 fi
119 ;;
120 *) val="$d_attribute_format" ;;
121 esac
122 set d_attribute_format
123 eval $setvar
124 $rm -f attrib*
125
126 : Look for GCC-style attribute malloc
127 case "$d_attribute_malloc" in
128 '')
129 echo " "
130 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
131 $cat >attrib.c <<'EOCP'
132 #include <stdio.h>
133 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
134 EOCP
135 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
136         if $contains 'warning' attrib.out >/dev/null 2>&1; then
137                 echo "Your C compiler doesn't support __attribute__((malloc))."
138                 val="$undef"
139         else
140                 echo "Your C compiler supports __attribute__((malloc))."
141                 val="$define"
142         fi
143 else
144         echo "Your C compiler doesn't seem to understand __attribute__ at all."
145         val="$undef"
146 fi
147 ;;
148 *) val="$d_attribute_malloc" ;;
149 esac
150 set d_attribute_malloc
151 eval $setvar
152 $rm -f attrib*
153
154 : Look for GCC-style attribute nonnull
155 case "$d_attribute_nonnull" in
156 '')
157 echo " "
158 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
159 $cat >attrib.c <<'EOCP'
160 #include <stdio.h>
161 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
162 EOCP
163 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
164         if $contains 'warning' attrib.out >/dev/null 2>&1; then
165                 echo "Your C compiler doesn't support __attribute__((nonnull))."
166                 val="$undef"
167         else
168                 echo "Your C compiler supports __attribute__((nonnull))."
169                 val="$define"
170         fi
171 else
172         echo "Your C compiler doesn't seem to understand __attribute__ at all."
173         val="$undef"
174 fi
175 ;;
176 *) val="$d_attribute_nonnull" ;;
177 esac
178 set d_attribute_nonnull
179 eval $setvar
180 $rm -f attrib*
181
182 : Look for GCC-style attribute noreturn
183 case "$d_attribute_noreturn" in
184 '')
185 echo " "
186 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
187 $cat >attrib.c <<'EOCP'
188 #include <stdio.h>
189 void fall_over_dead( void ) __attribute__((noreturn));
190 EOCP
191 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
192         if $contains 'warning' attrib.out >/dev/null 2>&1; then
193                 echo "Your C compiler doesn't support __attribute__((noreturn))."
194                 val="$undef"
195         else
196                 echo "Your C compiler supports __attribute__((noreturn))."
197                 val="$define"
198         fi
199 else
200         echo "Your C compiler doesn't seem to understand __attribute__ at all."
201         val="$undef"
202 fi
203 ;;
204 *) val="$d_attribute_noreturn" ;;
205 esac
206 set d_attribute_noreturn
207 eval $setvar
208 $rm -f attrib*
209
210 : Look for GCC-style attribute pure
211 case "$d_attribute_pure" in
212 '')
213 echo " "
214 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
215 $cat >attrib.c <<'EOCP'
216 #include <stdio.h>
217 int square( int n ) __attribute__((pure));
218 EOCP
219 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
220         if $contains 'warning' attrib.out >/dev/null 2>&1; then
221                 echo "Your C compiler doesn't support __attribute__((pure))."
222                 val="$undef"
223         else
224                 echo "Your C compiler supports __attribute__((pure))."
225                 val="$define"
226         fi
227 else
228         echo "Your C compiler doesn't seem to understand __attribute__ at all."
229         val="$undef"
230 fi
231 ;;
232 *) val="$d_attribute_pure" ;;
233 esac
234 set d_attribute_pure
235 eval $setvar
236 $rm -f attrib*
237
238 : Look for GCC-style attribute unused
239 case "$d_attribute_unused" in
240 '')
241 echo " "
242 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
243 $cat >attrib.c <<'EOCP'
244 #include <stdio.h>
245 int do_something( int dummy __attribute__((unused)), int n );
246 EOCP
247 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
248         if $contains 'warning' attrib.out >/dev/null 2>&1; then
249                 echo "Your C compiler doesn't support __attribute__((unused))."
250                 val="$undef"
251         else
252                 echo "Your C compiler supports __attribute__((unused))."
253                 val="$define"
254         fi
255 else
256         echo "Your C compiler doesn't seem to understand __attribute__ at all."
257         val="$undef"
258 fi
259 ;;
260 *) val="$d_attribute_unused" ;;
261 esac
262 set d_attribute_unused
263 eval $setvar
264 $rm -f attrib*
265
266 : Look for GCC-style attribute warn_unused_result
267 case "$d_attribute_warn_unused_result" in
268 '')
269 echo " "
270 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
271 $cat >attrib.c <<'EOCP'
272 #include <stdio.h>
273 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
274 EOCP
275 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
276         if $contains 'warning' attrib.out >/dev/null 2>&1; then
277                 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
278                 val="$undef"
279         else
280                 echo "Your C compiler supports __attribute__((warn_unused_result))."
281                 val="$define"
282         fi
283 else
284         echo "Your C compiler doesn't seem to understand __attribute__ at all."
285         val="$undef"
286 fi
287 ;;
288 *) val="$d_attribute_warn_unused_result" ;;
289 esac
290 set d_attribute_warn_unused_result
291 eval $setvar
292 $rm -f attrib*
293