source: patches/flex-2.5.35-gcc44-1.patch@ 5d3d725

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 5d3d725 was ab51b1c, checked in by Jim Gifford <clfs@…>, 15 years ago

Added Patch to Flex

  • Property mode set to 100644
File size: 12.2 KB
RevLine 
[ab51b1c]1Submitted By: Jim Gifford (jim at cross-lfs dot org)
2Date: 2009-08-12
3Initial Package Version: 2.5.35
4Origin: Debian
5Upstream Status: Unknown
6Description: Corrects code generation for GCC 4.4.x
7
8diff -Naur flex-2.5.35.orig/flexint.h flex-2.5.35/flexint.h
9--- flex-2.5.35.orig/flexint.h 2006-03-20 18:17:56.000000000 -0800
10+++ flex-2.5.35/flexint.h 2009-08-12 18:25:23.000000000 -0700
11@@ -28,7 +28,6 @@
12 typedef unsigned char flex_uint8_t;
13 typedef unsigned short int flex_uint16_t;
14 typedef unsigned int flex_uint32_t;
15-#endif /* ! C99 */
16
17 /* Limits of integral types. */
18 #ifndef INT8_MIN
19@@ -59,5 +58,6 @@
20 #define UINT32_MAX (4294967295U)
21 #endif
22
23+#endif /* ! C99 */
24
25 #endif /* ! FLEXINT_H */
26diff -Naur flex-2.5.35.orig/flex.skl flex-2.5.35/flex.skl
27--- flex-2.5.35.orig/flex.skl 2008-02-09 10:54:56.000000000 -0800
28+++ flex-2.5.35/flex.skl 2009-08-12 18:25:23.000000000 -0700
29@@ -218,6 +218,7 @@
30 #include <iostream>
31 #include <errno.h>
32 #include <cstdlib>
33+#include <cstdio>
34 #include <cstring>
35 /* end standard C++ headers. */
36 %endif
37@@ -443,7 +444,15 @@
38
39 /* Size of default input buffer. */
40 #ifndef YY_BUF_SIZE
41+#ifdef __ia64__
42+/* On IA-64, the buffer size is 16k, not 8k.
43+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
44+ * Ditto for the __ia64__ case accordingly.
45+ */
46+#define YY_BUF_SIZE 32768
47+#else
48 #define YY_BUF_SIZE 16384
49+#endif /* __ia64__ */
50 #endif
51
52 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
53@@ -1063,7 +1072,12 @@
54
55 /* Amount of stuff to slurp up with each read. */
56 #ifndef YY_READ_BUF_SIZE
57+#ifdef __ia64__
58+/* On IA-64, the buffer size is 16k, not 8k */
59+#define YY_READ_BUF_SIZE 16384
60+#else
61 #define YY_READ_BUF_SIZE 8192
62+#endif /* __ia64__ */
63 #endif
64
65 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
66@@ -1074,7 +1088,7 @@
67 /* This used to be an fputs(), but since the string might contain NUL's,
68 * we now use fwrite().
69 */
70-#define ECHO fwrite( yytext, yyleng, 1, yyout )
71+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
72 %endif
73 %if-c++-only C++ definition
74 #define ECHO LexerOutput( yytext, yyleng )
75@@ -2348,8 +2362,8 @@
76 %if-c-only
77 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
78 * scan from a @e copy of @a bytes.
79- * @param bytes the byte buffer to scan
80- * @param len the number of bytes in the buffer pointed to by @a bytes.
81+ * @param yybytes the byte buffer to scan
82+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
83 * M4_YY_DOC_PARAM
84 * @return the newly allocated buffer state object.
85 */
86diff -Naur flex-2.5.35.orig/gen.c flex-2.5.35/gen.c
87--- flex-2.5.35.orig/gen.c 2007-05-30 23:21:57.000000000 -0700
88+++ flex-2.5.35/gen.c 2009-08-12 18:25:23.000000000 -0700
89@@ -1890,7 +1890,7 @@
90 outn ("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\");
91 outn ("\t\t{ \\");
92 outn ("\t\tint c = '*'; \\");
93- outn ("\t\tint n; \\");
94+ outn ("\t\tsize_t n; \\");
95 outn ("\t\tfor ( n = 0; n < max_size && \\");
96 outn ("\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\");
97 outn ("\t\t\tbuf[n] = (char) c; \\");
98diff -Naur flex-2.5.35.orig/scan.c flex-2.5.35/scan.c
99--- flex-2.5.35.orig/scan.c 2008-02-26 13:34:23.000000000 -0800
100+++ flex-2.5.35/scan.c 2009-08-12 18:41:52.000000000 -0700
101@@ -1,5 +1,6 @@
102+#line 2 "scan.c"
103
104-#line 3 "scan.c"
105+#line 4 "scan.c"
106
107 #define YY_INT_ALIGNED short int
108
109@@ -53,7 +54,6 @@
110 typedef unsigned char flex_uint8_t;
111 typedef unsigned short int flex_uint16_t;
112 typedef unsigned int flex_uint32_t;
113-#endif /* ! C99 */
114
115 /* Limits of integral types. */
116 #ifndef INT8_MIN
117@@ -84,6 +84,8 @@
118 #define UINT32_MAX (4294967295U)
119 #endif
120
121+#endif /* ! C99 */
122+
123 #endif /* ! FLEXINT_H */
124
125 #ifdef __cplusplus
126@@ -140,7 +142,15 @@
127
128 /* Size of default input buffer. */
129 #ifndef YY_BUF_SIZE
130+#ifdef __ia64__
131+/* On IA-64, the buffer size is 16k, not 8k.
132+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
133+ * Ditto for the __ia64__ case accordingly.
134+ */
135+#define YY_BUF_SIZE 32768
136+#else
137 #define YY_BUF_SIZE 16384
138+#endif /* __ia64__ */
139 #endif
140
141 /* The state buf must be large enough to hold one state per character in the main buffer.
142@@ -2085,7 +2095,12 @@
143
144 /* Amount of stuff to slurp up with each read. */
145 #ifndef YY_READ_BUF_SIZE
146+#ifdef __ia64__
147+/* On IA-64, the buffer size is 16k, not 8k */
148+#define YY_READ_BUF_SIZE 16384
149+#else
150 #define YY_READ_BUF_SIZE 8192
151+#endif /* __ia64__ */
152 #endif
153
154 /* Copy whatever the last rule matched to the standard output. */
155@@ -2093,7 +2108,7 @@
156 /* This used to be an fputs(), but since the string might contain NUL's,
157 * we now use fwrite().
158 */
159-#define ECHO fwrite( yytext, yyleng, 1, yyout )
160+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
161 #endif
162
163 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
164@@ -2104,7 +2119,7 @@
165 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
166 { \
167 int c = '*'; \
168- int n; \
169+ size_t n; \
170 for ( n = 0; n < max_size && \
171 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
172 buf[n] = (char) c; \
173@@ -4639,9 +4654,19 @@
174 yyfree((void *) b );
175 }
176
177-#ifndef __cplusplus
178+#ifndef _UNISTD_H /* assume unistd.h has isatty() for us */
179+#ifdef __cplusplus
180+extern "C" {
181+#endif
182+#ifdef __THROW /* this is a gnuism */
183+extern int isatty (int ) __THROW;
184+#else
185 extern int isatty (int );
186-#endif /* __cplusplus */
187+#endif
188+#ifdef __cplusplus
189+}
190+#endif
191+#endif
192
193 /* Initializes or reinitializes a buffer.
194 * This function is sometimes called more than once on the same buffer,
195@@ -4847,8 +4872,8 @@
196
197 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
198 * scan from a @e copy of @a bytes.
199- * @param bytes the byte buffer to scan
200- * @param len the number of bytes in the buffer pointed to by @a bytes.
201+ * @param yybytes the byte buffer to scan
202+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
203 *
204 * @return the newly allocated buffer state object.
205 */
206diff -Naur flex-2.5.35.orig/skel.c flex-2.5.35/skel.c
207--- flex-2.5.35.orig/skel.c 2008-02-26 13:34:19.000000000 -0800
208+++ flex-2.5.35/skel.c 2009-08-12 18:41:52.000000000 -0700
209@@ -244,7 +244,6 @@
210 "typedef unsigned char flex_uint8_t; ",
211 "typedef unsigned short int flex_uint16_t;",
212 "typedef unsigned int flex_uint32_t;",
213- "#endif /* ! C99 */",
214 "",
215 "/* Limits of integral types. */",
216 "#ifndef INT8_MIN",
217@@ -275,6 +274,7 @@
218 "#define UINT32_MAX (4294967295U)",
219 "#endif",
220 "",
221+ "#endif /* ! C99 */",
222 "",
223 "#endif /* ! FLEXINT_H */",
224 "",
225@@ -285,6 +285,7 @@
226 "#include <iostream> ",
227 "#include <errno.h>",
228 "#include <cstdlib>",
229+ "#include <cstdio>",
230 "#include <cstring>",
231 "/* end standard C++ headers. */",
232 "%endif",
233@@ -510,7 +511,15 @@
234 "",
235 "/* Size of default input buffer. */",
236 "#ifndef YY_BUF_SIZE",
237+ "#ifdef __ia64__",
238+ "/* On IA-64, the buffer size is 16k, not 8k.",
239+ " * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.",
240+ " * Ditto for the __ia64__ case accordingly.",
241+ " */",
242+ "#define YY_BUF_SIZE 32768",
243+ "#else",
244 "#define YY_BUF_SIZE 16384",
245+ "#endif /* __ia64__ */",
246 "#endif",
247 "",
248 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
249@@ -1130,7 +1139,12 @@
250 "",
251 "/* Amount of stuff to slurp up with each read. */",
252 "#ifndef YY_READ_BUF_SIZE",
253+ "#ifdef __ia64__",
254+ "/* On IA-64, the buffer size is 16k, not 8k */",
255+ "#define YY_READ_BUF_SIZE 16384",
256+ "#else",
257 "#define YY_READ_BUF_SIZE 8192",
258+ "#endif /* __ia64__ */",
259 "#endif",
260 "",
261 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
262@@ -1141,7 +1155,7 @@
263 "/* This used to be an fputs(), but since the string might contain NUL's,",
264 " * we now use fwrite().",
265 " */",
266- "#define ECHO fwrite( yytext, yyleng, 1, yyout )",
267+ "#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)",
268 "%endif",
269 "%if-c++-only C++ definition",
270 "#define ECHO LexerOutput( yytext, yyleng )",
271@@ -2266,9 +2280,19 @@
272 "[[",
273 " m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],,",
274 " [[",
275- "#ifndef __cplusplus",
276+ "#ifndef _UNISTD_H /* assume unistd.h has isatty() for us */",
277+ "#ifdef __cplusplus",
278+ "extern \"C\" {",
279+ "#endif",
280+ "#ifdef __THROW /* this is a gnuism */",
281+ "extern int isatty M4_YY_PARAMS( int ) __THROW;",
282+ "#else",
283 "extern int isatty M4_YY_PARAMS( int );",
284- "#endif /* __cplusplus */",
285+ "#endif",
286+ "#ifdef __cplusplus",
287+ "}",
288+ "#endif",
289+ "#endif",
290 " ]])",
291 "]])",
292 "%endif",
293@@ -2559,8 +2583,8 @@
294 "%if-c-only",
295 "/** Setup the input buffer state to scan the given bytes. The next call to yylex() will",
296 " * scan from a @e copy of @a bytes.",
297- " * @param bytes the byte buffer to scan",
298- " * @param len the number of bytes in the buffer pointed to by @a bytes.",
299+ " * @param yybytes the byte buffer to scan",
300+ " * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.",
301 " * M4_YY_DOC_PARAM",
302 " * @return the newly allocated buffer state object.",
303 " */",
304diff -Naur flex-2.5.35.orig/tests/test-bison-nr/Makefile.am flex-2.5.35/tests/test-bison-nr/Makefile.am
305--- flex-2.5.35.orig/tests/test-bison-nr/Makefile.am 2006-11-09 12:14:46.000000000 -0800
306+++ flex-2.5.35/tests/test-bison-nr/Makefile.am 2009-08-12 18:25:23.000000000 -0700
307@@ -34,7 +34,7 @@
308
309 testname = test-bison-nr
310
311-scanner.c: $(srcdir)/scanner.l
312+scanner.c scanner.h: $(srcdir)/scanner.l
313 $(FLEX) $<
314
315 parser.c: $(srcdir)/parser.y
316@@ -50,4 +50,5 @@
317 $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
318
319 parser.h: parser.c
320-scanner.c main.o: parser.h
321+scanner.o: parser.h
322+main.o: parser.h scanner.h
323diff -Naur flex-2.5.35.orig/tests/test-bison-nr/Makefile.in flex-2.5.35/tests/test-bison-nr/Makefile.in
324--- flex-2.5.35.orig/tests/test-bison-nr/Makefile.in 2008-02-26 13:34:05.000000000 -0800
325+++ flex-2.5.35/tests/test-bison-nr/Makefile.in 2009-08-12 18:36:31.000000000 -0700
326@@ -343,7 +343,7 @@
327 uninstall-info-am
328
329
330-scanner.c: $(srcdir)/scanner.l
331+scanner.c scanner.h: $(srcdir)/scanner.l
332 $(FLEX) $<
333
334 parser.c: $(srcdir)/parser.y
335@@ -359,7 +359,8 @@
336 $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
337
338 parser.h: parser.c
339-scanner.c main.o: parser.h
340+scanner.o: parser.h
341+main.o: parser.h scanner.h
342 # Tell versions [3.59,3.63) of GNU make to not export all variables.
343 # Otherwise a system limit (for SysV at least) may be exceeded.
344 .NOEXPORT:
345diff -Naur flex-2.5.35.orig/tests/test-bison-yylloc/Makefile.am flex-2.5.35/tests/test-bison-yylloc/Makefile.am
346--- flex-2.5.35.orig/tests/test-bison-yylloc/Makefile.am 2006-11-09 12:14:46.000000000 -0800
347+++ flex-2.5.35/tests/test-bison-yylloc/Makefile.am 2009-08-12 18:25:23.000000000 -0700
348@@ -34,7 +34,7 @@
349
350 testname = test-bison-yylloc
351
352-scanner.c: $(srcdir)/scanner.l
353+scanner.c scanner.h: $(srcdir)/scanner.l
354 $(FLEX) $<
355
356 parser.c: $(srcdir)/parser.y
357@@ -50,4 +50,5 @@
358 $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
359
360 parser.h: parser.c
361-scanner.c main.o: parser.h
362+scanner.o: parser.h
363+main.o: parser.h scanner.h
364diff -Naur flex-2.5.35.orig/tests/test-bison-yylloc/Makefile.in flex-2.5.35/tests/test-bison-yylloc/Makefile.in
365--- flex-2.5.35.orig/tests/test-bison-yylloc/Makefile.in 2008-02-26 13:34:06.000000000 -0800
366+++ flex-2.5.35/tests/test-bison-yylloc/Makefile.in 2009-08-12 18:32:20.000000000 -0700
367@@ -343,7 +343,7 @@
368 uninstall-info-am
369
370
371-scanner.c: $(srcdir)/scanner.l
372+scanner.c scanner.h: $(srcdir)/scanner.l
373 $(FLEX) $<
374
375 parser.c: $(srcdir)/parser.y
376@@ -359,7 +359,8 @@
377 $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
378
379 parser.h: parser.c
380-scanner.c main.o: parser.h
381+scanner.o: parser.h
382+main.o: parser.h scanner.h
383 # Tell versions [3.59,3.63) of GNU make to not export all variables.
384 # Otherwise a system limit (for SysV at least) may be exceeded.
385 .NOEXPORT:
386diff -Naur flex-2.5.35.orig/tests/test-bison-yylval/Makefile.am flex-2.5.35/tests/test-bison-yylval/Makefile.am
387--- flex-2.5.35.orig/tests/test-bison-yylval/Makefile.am 2006-11-09 12:14:46.000000000 -0800
388+++ flex-2.5.35/tests/test-bison-yylval/Makefile.am 2009-08-12 18:25:23.000000000 -0700
389@@ -34,7 +34,7 @@
390
391 testname = test-bison-yylval
392
393-scanner.c: $(srcdir)/scanner.l
394+scanner.c scanner.h: $(srcdir)/scanner.l
395 $(FLEX) $<
396
397 parser.c: $(srcdir)/parser.y
398@@ -50,4 +50,4 @@
399 $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
400
401 parser.h: parser.c
402-main.o: parser.h
403+main.o: parser.h scanner.h
Note: See TracBrowser for help on using the repository browser.