source: patches/flex-2.5.35-gcc44-1.patch@ 41969c7

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 41969c7 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
  • flex-2.5.35

    Submitted By: Jim Gifford (jim at cross-lfs dot org)
    Date: 2009-08-12
    Initial Package Version: 2.5.35
    Origin: Debian
    Upstream Status: Unknown
    Description: Corrects code generation for GCC 4.4.x
     
    diff -Naur flex-2.5.35.orig/flexint.h flex-2.5.35/flexint.h
    old new  
    2828typedef unsigned char flex_uint8_t;
    2929typedef unsigned short int flex_uint16_t;
    3030typedef unsigned int flex_uint32_t;
    31 #endif /* ! C99 */
    3231
    3332/* Limits of integral types. */
    3433#ifndef INT8_MIN
     
    5958#define UINT32_MAX             (4294967295U)
    6059#endif
    6160
     61#endif /* ! C99 */
    6262
    6363#endif /* ! FLEXINT_H */
  • flex-2.5.35

    diff -Naur flex-2.5.35.orig/flex.skl flex-2.5.35/flex.skl
    old new  
    218218#include <iostream>
    219219#include <errno.h>
    220220#include <cstdlib>
     221#include <cstdio>
    221222#include <cstring>
    222223/* end standard C++ headers. */
    223224%endif
     
    443444
    444445/* Size of default input buffer. */
    445446#ifndef YY_BUF_SIZE
     447#ifdef __ia64__
     448/* On IA-64, the buffer size is 16k, not 8k.
     449 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
     450 * Ditto for the __ia64__ case accordingly.
     451 */
     452#define YY_BUF_SIZE 32768
     453#else
    446454#define YY_BUF_SIZE 16384
     455#endif /* __ia64__ */
    447456#endif
    448457
    449458m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
     
    10631072
    10641073/* Amount of stuff to slurp up with each read. */
    10651074#ifndef YY_READ_BUF_SIZE
     1075#ifdef __ia64__
     1076/* On IA-64, the buffer size is 16k, not 8k */
     1077#define YY_READ_BUF_SIZE 16384
     1078#else
    10661079#define YY_READ_BUF_SIZE 8192
     1080#endif /* __ia64__ */
    10671081#endif
    10681082
    10691083m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
     
    10741088/* This used to be an fputs(), but since the string might contain NUL's,
    10751089 * we now use fwrite().
    10761090 */
    1077 #define ECHO fwrite( yytext, yyleng, 1, yyout )
     1091#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
    10781092%endif
    10791093%if-c++-only C++ definition
    10801094#define ECHO LexerOutput( yytext, yyleng )
     
    23482362%if-c-only
    23492363/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
    23502364 * scan from a @e copy of @a bytes.
    2351  * @param bytes the byte buffer to scan
    2352  * @param len the number of bytes in the buffer pointed to by @a bytes.
     2365 * @param yybytes the byte buffer to scan
     2366 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
    23532367 * M4_YY_DOC_PARAM
    23542368 * @return the newly allocated buffer state object.
    23552369 */
  • flex-2.5.35

    diff -Naur flex-2.5.35.orig/gen.c flex-2.5.35/gen.c
    old new  
    18901890                        outn ("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\");
    18911891                        outn ("\t\t{ \\");
    18921892                        outn ("\t\tint c = '*'; \\");
    1893                         outn ("\t\tint n; \\");
     1893                        outn ("\t\tsize_t n; \\");
    18941894                        outn ("\t\tfor ( n = 0; n < max_size && \\");
    18951895                        outn ("\t\t\t     (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\");
    18961896                        outn ("\t\t\tbuf[n] = (char) c; \\");
  • flex-2.5.35

    diff -Naur flex-2.5.35.orig/scan.c flex-2.5.35/scan.c
    old new  
     1#line 2 "scan.c"
    12
    2 #line 3 "scan.c"
     3#line 4 "scan.c"
    34
    45#define  YY_INT_ALIGNED short int
    56
     
    5354typedef unsigned char flex_uint8_t;
    5455typedef unsigned short int flex_uint16_t;
    5556typedef unsigned int flex_uint32_t;
    56 #endif /* ! C99 */
    5757
    5858/* Limits of integral types. */
    5959#ifndef INT8_MIN
     
    8484#define UINT32_MAX             (4294967295U)
    8585#endif
    8686
     87#endif /* ! C99 */
     88
    8789#endif /* ! FLEXINT_H */
    8890
    8991#ifdef __cplusplus
     
    140142
    141143/* Size of default input buffer. */
    142144#ifndef YY_BUF_SIZE
     145#ifdef __ia64__
     146/* On IA-64, the buffer size is 16k, not 8k.
     147 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
     148 * Ditto for the __ia64__ case accordingly.
     149 */
     150#define YY_BUF_SIZE 32768
     151#else
    143152#define YY_BUF_SIZE 16384
     153#endif /* __ia64__ */
    144154#endif
    145155
    146156/* The state buf must be large enough to hold one state per character in the main buffer.
     
    20852095   
    20862096/* Amount of stuff to slurp up with each read. */
    20872097#ifndef YY_READ_BUF_SIZE
     2098#ifdef __ia64__
     2099/* On IA-64, the buffer size is 16k, not 8k */
     2100#define YY_READ_BUF_SIZE 16384
     2101#else
    20882102#define YY_READ_BUF_SIZE 8192
     2103#endif /* __ia64__ */
    20892104#endif
    20902105
    20912106/* Copy whatever the last rule matched to the standard output. */
     
    20932108/* This used to be an fputs(), but since the string might contain NUL's,
    20942109 * we now use fwrite().
    20952110 */
    2096 #define ECHO fwrite( yytext, yyleng, 1, yyout )
     2111#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
    20972112#endif
    20982113
    20992114/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
     
    21042119        if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
    21052120                { \
    21062121                int c = '*'; \
    2107                 int n; \
     2122                size_t n; \
    21082123                for ( n = 0; n < max_size && \
    21092124                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
    21102125                        buf[n] = (char) c; \
     
    46394654        yyfree((void *) b  );
    46404655}
    46414656
    4642 #ifndef __cplusplus
     4657#ifndef _UNISTD_H /* assume unistd.h has isatty() for us */
     4658#ifdef __cplusplus
     4659extern "C" {
     4660#endif
     4661#ifdef __THROW /* this is a gnuism */
     4662extern int isatty (int ) __THROW;
     4663#else
    46434664extern int isatty (int );
    4644 #endif /* __cplusplus */
     4665#endif
     4666#ifdef __cplusplus
     4667}
     4668#endif
     4669#endif
    46454670   
    46464671/* Initializes or reinitializes a buffer.
    46474672 * This function is sometimes called more than once on the same buffer,
     
    48474872
    48484873/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
    48494874 * scan from a @e copy of @a bytes.
    4850  * @param bytes the byte buffer to scan
    4851  * @param len the number of bytes in the buffer pointed to by @a bytes.
     4875 * @param yybytes the byte buffer to scan
     4876 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
    48524877 *
    48534878 * @return the newly allocated buffer state object.
    48544879 */
  • flex-2.5.35

    diff -Naur flex-2.5.35.orig/skel.c flex-2.5.35/skel.c
    old new  
    244244  "typedef unsigned char flex_uint8_t; ",
    245245  "typedef unsigned short int flex_uint16_t;",
    246246  "typedef unsigned int flex_uint32_t;",
    247   "#endif /* ! C99 */",
    248247  "",
    249248  "/* Limits of integral types. */",
    250249  "#ifndef INT8_MIN",
     
    275274  "#define UINT32_MAX             (4294967295U)",
    276275  "#endif",
    277276  "",
     277  "#endif /* ! C99 */",
    278278  "",
    279279  "#endif /* ! FLEXINT_H */",
    280280  "",
     
    285285  "#include <iostream> ",
    286286  "#include <errno.h>",
    287287  "#include <cstdlib>",
     288  "#include <cstdio>",
    288289  "#include <cstring>",
    289290  "/* end standard C++ headers. */",
    290291  "%endif",
     
    510511  "",
    511512  "/* Size of default input buffer. */",
    512513  "#ifndef YY_BUF_SIZE",
     514  "#ifdef __ia64__",
     515  "/* On IA-64, the buffer size is 16k, not 8k.",
     516  " * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.",
     517  " * Ditto for the __ia64__ case accordingly.",
     518  " */",
     519  "#define YY_BUF_SIZE 32768",
     520  "#else",
    513521  "#define YY_BUF_SIZE 16384",
     522  "#endif /* __ia64__ */",
    514523  "#endif",
    515524  "",
    516525  "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
     
    11301139  "",
    11311140  "/* Amount of stuff to slurp up with each read. */",
    11321141  "#ifndef YY_READ_BUF_SIZE",
     1142  "#ifdef __ia64__",
     1143  "/* On IA-64, the buffer size is 16k, not 8k */",
     1144  "#define YY_READ_BUF_SIZE 16384",
     1145  "#else",
    11331146  "#define YY_READ_BUF_SIZE 8192",
     1147  "#endif /* __ia64__ */",
    11341148  "#endif",
    11351149  "",
    11361150  "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
     
    11411155  "/* This used to be an fputs(), but since the string might contain NUL's,",
    11421156  " * we now use fwrite().",
    11431157  " */",
    1144   "#define ECHO fwrite( yytext, yyleng, 1, yyout )",
     1158  "#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)",
    11451159  "%endif",
    11461160  "%if-c++-only C++ definition",
    11471161  "#define ECHO LexerOutput( yytext, yyleng )",
     
    22662280  "[[",
    22672281  "    m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],,",
    22682282  "    [[",
    2269   "#ifndef __cplusplus",
     2283  "#ifndef _UNISTD_H /* assume unistd.h has isatty() for us */",
     2284  "#ifdef __cplusplus",
     2285  "extern \"C\" {",
     2286  "#endif",
     2287  "#ifdef __THROW /* this is a gnuism */",
     2288  "extern int isatty M4_YY_PARAMS( int ) __THROW;",
     2289  "#else",
    22702290  "extern int isatty M4_YY_PARAMS( int );",
    2271   "#endif /* __cplusplus */",
     2291  "#endif",
     2292  "#ifdef __cplusplus",
     2293  "}",
     2294  "#endif",
     2295  "#endif",
    22722296  "    ]])",
    22732297  "]])",
    22742298  "%endif",
     
    25592583  "%if-c-only",
    25602584  "/** Setup the input buffer state to scan the given bytes. The next call to yylex() will",
    25612585  " * scan from a @e copy of @a bytes.",
    2562   " * @param bytes the byte buffer to scan",
    2563   " * @param len the number of bytes in the buffer pointed to by @a bytes.",
     2586  " * @param yybytes the byte buffer to scan",
     2587  " * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.",
    25642588  " * M4_YY_DOC_PARAM",
    25652589  " * @return the newly allocated buffer state object.",
    25662590  " */",
  • tests/test-bison-nr/Makefile.am

    diff -Naur flex-2.5.35.orig/tests/test-bison-nr/Makefile.am flex-2.5.35/tests/test-bison-nr/Makefile.am
    old new  
    3434
    3535testname = test-bison-nr
    3636
    37 scanner.c: $(srcdir)/scanner.l
     37scanner.c scanner.h: $(srcdir)/scanner.l
    3838        $(FLEX) $<
    3939
    4040parser.c: $(srcdir)/parser.y
     
    5050        $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
    5151
    5252parser.h: parser.c
    53 scanner.c main.o: parser.h
     53scanner.o: parser.h
     54main.o: parser.h scanner.h
  • tests/test-bison-nr/Makefile.in

    diff -Naur flex-2.5.35.orig/tests/test-bison-nr/Makefile.in flex-2.5.35/tests/test-bison-nr/Makefile.in
    old new  
    343343        uninstall-info-am
    344344
    345345
    346 scanner.c: $(srcdir)/scanner.l
     346scanner.c scanner.h: $(srcdir)/scanner.l
    347347        $(FLEX) $<
    348348
    349349parser.c: $(srcdir)/parser.y
     
    359359        $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
    360360
    361361parser.h: parser.c
    362 scanner.c main.o: parser.h
     362scanner.o: parser.h
     363main.o: parser.h scanner.h
    363364# Tell versions [3.59,3.63) of GNU make to not export all variables.
    364365# Otherwise a system limit (for SysV at least) may be exceeded.
    365366.NOEXPORT:
  • tests/test-bison-yylloc/Makefile.am

    diff -Naur flex-2.5.35.orig/tests/test-bison-yylloc/Makefile.am flex-2.5.35/tests/test-bison-yylloc/Makefile.am
    old new  
    3434
    3535testname = test-bison-yylloc
    3636
    37 scanner.c: $(srcdir)/scanner.l
     37scanner.c scanner.h: $(srcdir)/scanner.l
    3838        $(FLEX) $<
    3939
    4040parser.c: $(srcdir)/parser.y
     
    5050        $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
    5151
    5252parser.h: parser.c
    53 scanner.c main.o: parser.h
     53scanner.o: parser.h
     54main.o: parser.h scanner.h
  • tests/test-bison-yylloc/Makefile.in

    diff -Naur flex-2.5.35.orig/tests/test-bison-yylloc/Makefile.in flex-2.5.35/tests/test-bison-yylloc/Makefile.in
    old new  
    343343        uninstall-info-am
    344344
    345345
    346 scanner.c: $(srcdir)/scanner.l
     346scanner.c scanner.h: $(srcdir)/scanner.l
    347347        $(FLEX) $<
    348348
    349349parser.c: $(srcdir)/parser.y
     
    359359        $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
    360360
    361361parser.h: parser.c
    362 scanner.c main.o: parser.h
     362scanner.o: parser.h
     363main.o: parser.h scanner.h
    363364# Tell versions [3.59,3.63) of GNU make to not export all variables.
    364365# Otherwise a system limit (for SysV at least) may be exceeded.
    365366.NOEXPORT:
  • tests/test-bison-yylval/Makefile.am

    diff -Naur flex-2.5.35.orig/tests/test-bison-yylval/Makefile.am flex-2.5.35/tests/test-bison-yylval/Makefile.am
    old new  
    3434
    3535testname = test-bison-yylval
    3636
    37 scanner.c: $(srcdir)/scanner.l
     37scanner.c scanner.h: $(srcdir)/scanner.l
    3838        $(FLEX) $<
    3939
    4040parser.c: $(srcdir)/parser.y
     
    5050        $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
    5151
    5252parser.h: parser.c
    53 main.o: parser.h
     53main.o: parser.h scanner.h
Note: See TracBrowser for help on using the repository browser.