NetBSD/external/bsd/flex/dist/tests/string_r.l

104 lines
2.9 KiB
Plaintext
Raw Normal View History

2016-01-09 18:43:18 +03:00
/*
* This file is part of flex.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE.
*/
%{
/* A template scanner file to build "scanner.c". */
#include <stdio.h>
#include <stdlib.h>
#include "config.h"
#define NUMBER 200
#define WORD 201
%}
%option 8bit prefix="test"
%option nounput nomain nodefault noyywrap noinput
%option warn reentrant
%%
[[:space:]]+ { }
[[:digit:]]+ { printf("NUMBER "); fflush(stdout);}
[[:alpha:]]+ { printf("WORD "); fflush(stdout);}
. {
fprintf(stderr,"*** Error: Unrecognized character '%c' while scanning.\n",
yytext[0]);
yyterminate();
}
<<EOF>> { printf("<<EOF>>\n"); yyterminate();}
%%
#define INPUT_STRING_1 "1234 foo bar"
#define INPUT_STRING_2 "1234 foo bar *@&@&###@^$#&#*"
int main(void);
int
2016-12-30 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS for 2.6.3 release 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: New configure option '--disable-bootstrap'. If configure is run with '--disable-bootstrap', then stage1flex won't be built and stage1scan.c will be generated by sed'ing scan.c. This option is intended to workaround bootstrap bugs rather than to fix the bootstrapping issues which are proving subtler and harder to fix than anyone would like. 2016-11-26 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: "make clean" deletes stage1scan.c, stage1flex 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: allow building libfl even with --disable-libfl. For various reasons, we may wish to build libfl explicitly even when configure has been run with the --disable-libfl option. This is possible, now, via 'make -C src libfl.la'. 2016-12-19 Alexis La Goutte <alexis.lagoutte@gmail.com> * src/flex.skl: scanner: remove trailing whitespace in skeleton 2016-12-01 Demi Obenour <demiobenour@gmail.com> * src/buf.c, src/main.c, src/parse.y: scanner: Disallow, overquote '[' and ']' in prefix 2016-12-29 Samuel Thibault <samuel.thibault@ens-lyon.org> * src/main.c: scanner: allocate correct buffer size for m4 path. Flex did not check the length of the m4 path which could lead to a buffer overflow in some cases. Additionally, not all platforms believe in PATH_MAX, so stop relying on it. Fixes #138 2016-11-24 Will Estes <westes575@gmail.com> * NEWS: doc: note no more libcompat in NEWS 2016-11-24 Will Estes <westes575@gmail.com> * lib/Makefile.am: build: explain empty lib/Makefile.am 2016-11-20 Explorer09 <explorer09@gmail.com> * configure.ac: build: warn about cross compiling with *alloc 2016-11-19 Explorer09 <explorer09@gmail.com> * configure.ac, lib/Makefile.am, lib/lib.c, src/Makefile.am: build: Link $(LIBOBJS) from src/ dir, remove libcompat.la. The libcompat.la library was small and less friendly to bootstrapping and cross compilation. Now, we will simply link individual object files as needed, which is simpler. 2016-11-16 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: Let stage1flex respect LFLAGS 2016-11-14 Will Estes <westes575@gmail.com> * NEWS: doc: describe --disable-libfl in NEWS 2016-10-31 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: Add --disable-libfl configure option. Disabling libfl is useful when building flex for a cross-toolchain. Fixes: GH-99 2016-11-09 Demi Obenour <demiobenour@gmail.com> * src/flex.skl, tests/array_r.l: fix backwards incompatible changes in 2.6.2. This patch addscompatibility `#defines` for all macros affected by `%prefix`. Fixes #113. 2016-11-08 Will Estes <westes575@gmail.com> * tests/.gitignore: git: ignore quote_in_comment artifacts 2016-11-08 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/Makefile.am, tests/quote_in_comment.l, tests/quote_in_comment.txt: Fixes a major bug in Flex's own lexing of literals. My changes caused Flex to mishandle string and character literals in line comments. This commit fixes them. Fixes #113. 2016-11-06 Thomas Klausner <wiz@NetBSD.org> * configure.ac: Fix unportable test(1) operator. "==" is only supported by bash, "=" is the standard comparison operator. 2016-11-02 Demi Obenour <demiobenour@gmail.com> * tests/quotes.l: Add more escaping tests 2016-11-01 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix another escaping bug in non-indented verbatim section 2 code. I also did some reformatting. 2016-10-28 Alastair Hughes <hobbitalastair@gmail.com> * configure.ac: build: fix false negatives for help2man and texi2dvi HELP2MAN and TEXI2DVI (or the corresponding ac_prog variables) will never be zero length as they fall back to the missing script; check for the fall back and warn on that instead of always warning. 2016-10-28 Explorer09 <explorer09@gmail.com> * doc/Makefile.am: doc: Don't delete flex.1 during "make distclean". flex.1 is pre-generated in release tarball. If we delete it, the next "configure and make" on the source directory will then require help2man unnecessarily. 2016-10-27 Alastair Hughes <hobbitalastair@gmail.com> * NEWS, doc/Makefile.am: Only regenerate the man page when required. Make the flex binary an order-only prerequisite, and add back the prerequisites from before 7cfb440. This prevents rebuilding the man page whenever the flex binary is rebuilt, which causes problems if help2man is not installed and will never work when cross compiling. Fixes #108. 2016-10-26 Will Estes <westes575@gmail.com> * NEWS, src/Makefile.am: build: no longer build PIC version of libfl. The PIC version of libfl was not being built correctly. From the lack of bug reports around this problem, we conclude that the PIC version of libfl is not used and so we drop it from the build build targets for flex. 2016-10-25 Explorer09 <explorer09@gmail.com> * README.md: doc: README.md formatting fixes * Wrap everything in the raw document in 72 char per line limit. * Proper casing for terms "Git" and "GitHub" (don't try to look lazy). * Add unordered list marks when needed. * Say `configure && make && make install` and quoted for fixed-width font. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> 2016-10-25 Will Estes <westes575@gmail.com> * NEWS, configure.ac: build: version 2.6.3 begins 2016-10-24 Will Estes <westes575@gmail.com> * NEWS: doc: mark 2.6.2 release date 2016-10-24 Will Estes <westes575@gmail.com> * .gitignore, NEWS, configure.ac: build: switch xz to lzip 2016-10-20 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/quotes.l: Fix M4 quotation in section 2 prologue and refactor duplicated code 2016-10-21 Alex Kennedy <alexzanderkennedy@gmail.com> * doc/flex.texi: Update flex.texi: Removed repedative wording "Flex used to" was written twice at the beginning of Chapter 9, paragraph 2. 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/dfa.c, src/gen.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, tests/bison_yylval_scanner.l, tests/include_by_push.direct.l: Improved M4 quotation This fixes M4 quotation of certain strings beginning with `yy` (in section 3 of the input file only) and character literals. The new quotation method is also less brittle and faster. Tests that relied on the old behavior were fixed. Also, `yyconst` is no longer defined; use `const` (which it unconditionally was defined to) instead. 2016-10-19 Will Estes <westes575@gmail.com> * Makefile.am, configure.ac: build: for automake, flex is foreign 2016-10-19 Will Estes <westes575@gmail.com> * README, README.md: doc: mv README to README.md 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: touch up README 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: README no longer mentions sourceforge 2016-10-06 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS with more post-2.6.1 additions 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/options.c, src/options.h, src/scan.l, src/yylex.c, tests/Makefile.am, tests/alloc_extra.l, tests/array_r.l, tests/basic_r.l, tests/c_cxx_nr.lll, tests/c_cxx_r.lll, tests/debug_r.l, tests/include_by_reentrant.direct.l, tests/lineno_r.l, tests/mem_nr.l, tests/mem_r.l, tests/posix.l, tests/posixly_correct.l, tests/pthread.l, tests/quotes.l, tests/reject.l4, tests/rescan_nr.direct.l, tests/rescan_r.direct.l, tests/string_nr.l, tests/string_r.l: Fix M4 quoting of section 3. This fixes M4 quoting of section 3 of the input file, including escape sequences and character constants. Tests were added to verify the behavior in section 3 with respect to quoting. Both escaping of quotes and quoting of potential macro-start characters are tested. Existing tests were also fixed to account for the new -- and now correct -- behavior. Many tests relied on the old behavior of expanding M4 macros in section 3. They needed to be updated for the new behavior. 2016-10-03 Mightyjo <mightyjo@gmail.com> * src/flex.skl, tests/.gitignore, tests/Makefile.am, tests/cxx_restart.ll, tests/cxx_restart.txt: Fix yyrestart(NULL) SEGV. 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/scan.l: scanner: M4 quoting fixes 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am: Support `make indent` for out of source builds 2016-09-24 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am, src/mkskel.sh: Simplify some shell code 2016-09-23 Demi Obenour <demiobenour@gmail.com> * doc/flex.texi, src/flex.skl, src/flexdef.h, src/main.c, src/options.c, src/options.h, src/scan.l, tests/.gitignore, tests/Makefile.am, tests/noansi_nr.l, tests/noansi_nr.txt, tests/noansi_r.l, tests/noansi_r.txt: no longer generate K&R C scanners 2016-09-04 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix escaping of `[[` and `]]` in strings Previously, `[[` and `]]` were not escaped in strings, which led to bad interactions with m4. Also, don't break strings on newline, as GCC et al support whitespace between a backslash and the subsequent newline. 2016-06-20 Translation Project <coordinator@translationproject.org> * NEWS, po/sv.po: new sv translation 2016-05-23 Demetri Obenour <demiobenour@gmail.com> * src/misc.c: Delete action_m4_define from misc.c This function was not used and always triggered a fatal error when run. 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am, tests/testwrapper-direct.sh: test: run direct tests from srcdir 2016-01-11 Egor Pugin <egor.pugin@gmail.com> * tests/include_by_buffer.direct.l, tests/include_by_push.direct.l, tests/include_by_reentrant.direct.l: Exited with error code on some conditions in include tests 2016-05-20 Will Estes <westes575@gmail.com> * tests/testwrapper.sh: test: drop .exe when making input file names 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am: test: removed dependencies for include tests 2016-04-28 Tobias Klauser <tklauser@distanz.ch> * src/scanflags.c: Avoid realloc on every call of sf_push() Currently, every call to sf_push() realloc()'s _sf_stack, even if the maximum size _sf_max wasn't changed. As the indentation beneath the "if" clause already indicates, the realloc() should only be executed if _sf_max was increased. Found by compiling flex with the -Wmisleading-indentation flags of gcc, which leads to the following warning: scanflags.c: In function ‘sf_push’: scanflags.c:42:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (_sf_top_ix + 1 >= _sf_max) ^~ scanflags.c:44:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ _sf_stk = realloc(_sf_stk, sizeof(scanflags_t) * _sf_max); ^~~~~~~ 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: prettified command to build man page 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: added man page to DISTCLEANFILES 2016-03-31 Will Estes <westes575@gmail.com> * BUGS, TODO: remove unused TODO, BUGS files 2016-03-31 Will Estes <westes575@gmail.com> * to.do/README, to.do/Wilhelms.todo, to.do/Wish-List, to.do/flex.rmail, to.do/streams.mail, to.do/unicode/FlexLexer.h, to.do/unicode/ccl.c, to.do/unicode/changes.txt, to.do/unicode/ecs.c, to.do/unicode/flex.1, to.do/unicode/flex.skl, to.do/unicode/flexdef.h, to.do/unicode/gen.c, to.do/unicode/main.c, to.do/unicode/misc.c, to.do/unicode/scan.l, to.do/unicode/tblcmp.c: removed to.do/ directory 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: removed flex.skl from POTFILES.in file list 2016-03-31 rlar <rlar> * src/Makefile.am: fix skel.c dependency (missing tables_shared.c) and polish build rule Also remove references to srcdir since skel.c is no longer mentioned in po/POTFILES.in. 2016-03-31 rlar <rlar> * doc/Makefile.am: fix flex.1 dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 && \ make dist failed with: > help2man: can't get `--help' info from ../../flex/src/flex Note: There is no dependency except for the flex binary. 2016-03-31 rlar <rlar> * src/Makefile.am: fix stage1scan.c and stage1scan.l dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 failed with: > ../src/stage1flex -o stage1scan.c stage1scan.l > stage1flex: can't open stage1scan.l Note: stage1scan.c is not necessairy in the "make dist" generated tar.gz file. stage1flex will be build from scan.c (which is distributed), and this will then generate stage1scan.c from scan.l 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: list src/flex.skl in po/POTFILES.in 2016-03-29 rlar <rlar> * src/gen.c: warning in generated code, with -Ca warning: conversion to 'yy_state_type' from 'flex_uint32_t' may change the sign of the result [-Wsign-conversion] 2016-03-29 rlar <rlar> * tests/Makefile.am: suppress `WARNINGFLAGS' for the almost obsolete `noansi' test cases 2016-03-29 rlar <rlar> * configure.ac, src/Makefile.am, tests/Makefile.am: configure option `--enable-warnings' and `WARNINGFLAGS' `WARNINGFLAGS' can be passed when invoking `configure' and when invoking `make' if configure switch `--enable-warnings' was given then default to something useful if we have `GCC' `WARNINGFLAGS' is not used when compiling `stage1flex' to avoid unnecessary clutter 2016-03-31 Tobias Klauser <tklauser@distanz.ch> * src/main.c: Fix potential buffer overflow in strncat() When using clang/llvm 3.8 to compile flex, the following warning is emitted: main.c:378:27: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size] strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ main.c:378:27: note: change the argument to be the free space in the destination buffer minus the terminating null byte strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ sizeof(m4_path) - strlen(m4_path) - 1Fix it up by using the solution proposed by the warning message. 2016-03-29 Robert.Larice Robert Larice <Robert.Larice@t-online.de> * src/Makefile.am: build: simplified dependency tracking so parallel make runs succeed 2016-03-20 rlar <rlar> * src/flex.skl, src/gen.c, src/main.c: avoid warning in generated code, with -Cf warning: conversion to 'unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-18 Will Estes <westes575@gmail.com> * NEWS, configure.ac: mention v2.6.2; summarize changes since 2.6.1 2016-03-18 Will Estes <westes575@gmail.com> * doc/flex.texi: doc: corrected example in manual, gh#67 2016-03-16 rlar <rlar> * tests/string_nr.l, tests/string_r.l, tests/yyextra.l: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * tests/mem_nr.l, tests/mem_r.l, tests/pthread.l: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * src/flex.skl: warning: conversion to 'flex_uint32_t' from 'long unsigned int' may alter its value [-Wconversion] struct yytbl_reader, member bread is of type flex_uint32_t 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/bison_nr_main.c, tests/bison_nr_parser.y, tests/bison_yylloc_parser.y: warning: redundant redeclaration of '...' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/bison_nr_parser.y, tests/bison_yylloc_parser.y, tests/bison_yylval_parser.y, tests/pthread.l: warning: no previous prototype for '...' [-Wmissing-prototypes] 2016-03-16 rlar <rlar> * tests/multiple_scanners_r_main.c: warning: unused variable 'fp' [-Wunused-variable] 2016-03-16 rlar <rlar> * tests/pthread.l: main(), warning: redundant redeclaration of 'main' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/include_by_reentrant.direct.l, tests/lineno_nr.l, tests/lineno_r.l, tests/lineno_trailing.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/array_nr.l, tests/array_r.l, tests/basic_nr.l, tests/basic_r.l, tests/ccl.l, tests/debug_nr.l, tests/debug_r.l, tests/extended.l, tests/mem_nr.l, tests/mem_r.l, tests/noansi_r.l, tests/posix.l, tests/posixly_correct.l, tests/prefix_nr.l, tests/prefix_r.l, tests/quotes.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-01 rlar <rlar> * src/ecs.c, src/tblcmp.c: Fix two more casts 2016-03-14 Bastian Köcher <git@kchr.de> * src/gen.c: Fixes yyl compare with unsigned warning 2016-03-13 Robert Larice <Robert.Larice@t-online.de> * configure.ac: Suppress portability warnings in Makefile generation 2016-02-27 rlar <rlar> * src/flex.skl: generated code, in yyensure_buffer_stack(), change type of local `num_to_alloc' which is exclusively used in yy_size_t context 2016-03-01 rlar <rlar> * src/flex.skl: generated code, in yy_get_next_buffer(), change type of local `number_to_move' suits better, because `yy_n_chars' and `yy_buf_size' are of type `int' 2016-02-27 rlar <rlar> * src/flex.skl: generated code, `_yybytes_len' is of type `int', fix code accordingly 2016-02-28 rlar <rlar> * src/gen.c: generated code, `max_size' seems to be of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, here `new_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `yy_buf_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `offset' is of type `int' 2016-02-28 rlar <rlar> * src/gen.c: generated code, `yy_more_len' is of type `int' 2016-02-28 rlar <rlar> * src/scan.l: scan.l, rewrite two loops to avoid unneccesairy casting 2016-03-01 rlar <rlar> * src/regex.c, src/tables.c: improve readability 2016-02-28 rlar <rlar> * src/tblcmp.c: another cast in tblcmp.c to avoid warning 2016-02-28 rlar <rlar> * src/buf.c: casts in buf_append() to get rid of warnings 2016-02-28 rlar <rlar> * src/dfa.c, src/gen.c: cast to suite type of flex_uint32_t td_lolen 2016-02-28 rlar <rlar> * src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanopt.c, src/tables_shared.c: cast to get rid of warnings 2016-03-01 rlar <rlar> * src/buf.c, src/main.c: cast and fix usage of log10(), ceil to prevent buffer overflow 2016-03-01 rlar <rlar> * src/tables.c: tables.c, sprinkle casts to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_data_compress(), change type of local newsz to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c, src/tables.h: change type of struct yytbl_writer.total_written to get rid of warnings 2016-02-28 rlar <rlar> * src/tables.c: change argument type of yytbl_writen() to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_write8/16/32(), change type of local variables to get rid of warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/misc.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: change return type and rename int htoi()/otoi() --> unsigned int htoui()/otoui() 2016-03-01 Will Estes <westes575@gmail.com> * NEWS: Mention 2.6.1 release date 2016-02-28 rlar <rlar> * src/gen.c: avoid warning, add (int) cast to the read() return value For similiarity with the fread() case. 2016-02-28 rlar <rlar> * src/scan.l: avoid warning, POSIX says yyless() has an `int' argument 2016-02-29 rlar <rlar> * src/filter.c: use type size_t in filter_tee_header() to avoid warnings 2016-02-29 rlar <rlar> * src/filter.c, src/misc.c, src/scanopt.c, src/tables.c: add (size_t) casts to malloc invocations to prevent warnings 2016-02-29 rlar <rlar> * src/buf.c, src/misc.c, src/scan.l, src/scanopt.c, src/tables.c: add (int) casts to some strlen() invocations to prevent warnings 2016-02-29 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndlookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndinstal(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: cclinstal() and ccllookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/gen.c: warning: redundant redeclaration of ‘gen_next_state’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/gen.c: warning: no previous prototype for ‘mkecstbl’ [-Wmissing-prototypes] 2016-02-28 rlar <rlar> * src/main.c: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yywrap’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yylval’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yyin’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h, src/main.c: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: unification, rename some more rename these too for improved similiarity: OPTION_OP OPT_HEADER OPT_EXTRA_TYPE OPT_TABLES 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: fix name clash, OPT_OUTFILE from parse.y and from options.h these collide: OPT_OUTFILE OPT_PREFIX OPT_YYCLASS rename them TOK_... in the parser 2016-02-28 Will Estes <westes575@gmail.com> * lib/reallocarray.c: Prototyped reallocarray implementation 2016-02-28 Will Estes <westes575@gmail.com> * src/scanopt.c: Removed custom strcasecmp() function 2016-02-28 rlar <rlar> * src/flex.skl: fwrite wants a size_t, yyleng is int per posix 2016-02-28 rlar <rlar> * src/scanopt.c: Remove some unneeded casts 2016-02-28 rlar <rlar> * src/flexdef.h: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion] 2016-02-27 rlar <rlar> * src/dfa.c, src/parse.y: dfa.c:157:24: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] most certainly safe cast 2016-02-27 rlar <rlar> * src/ccl.c: ccl.c:86:19: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion] ch seems to have been checked for proper range some lines above 2016-02-27 rlar <rlar> * tests/bison_nr_parser.y: warning: deprecated directive, use '%pure-parser' [-Wdeprecated] 2016-02-27 rlar <rlar> * lib/lib.c: warning: no previous prototype for 'do_nothing' [-Wmissing-prototypes] 2016-02-27 rlar <rlar> * src/libmain.c: included stdlib.h header 2016-02-27 Will Estes <westes575@gmail.com> * NEWS: Described more post v2.6.0 changes 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: build: Removed bzip2 distribiution archive 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: removed obsolete program check 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: Made some program checks more robust 2016-02-27 rlar <rlar> * src/flex.skl: Remove unneeded cast to int 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fixed incorrect integer type 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fix more integer types, resolves sf 184, 187 2016-02-26 Robert Larice <Robert.Larice@t-online.de> * src/flex.skl, src/gen.c: Removed some type conversion warnings 2016-02-26 Will Estes <westes575@gmail.com> * src/flex.skl: Changed another buffer size to int; resolves gh#61 2016-02-24 Will Estes <westes575@gmail.com> * src/flex.skl: Changed type of yy_n_chars to int; gh#53, sf#160. The variable yy_n_chars had been of type yy_size_t which is incorrect given its use in read(). While it might be adviseable to look at defining a yy_ssize_t, there might be some issues doing this and so, for now, at least, we'll punt back to int. 2016-02-24 Will Estes <westes575@gmail.com> * src/buf.c: Fixed size of bufferallocation, resolved gh#54. The value of n_alloc was a count, not a size. Multiplying the value by the element size was incorrect. That multiplication was already being done and having it done twice was incorrect. 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/scan.l: Allow '%option noline' in flex input file, resolves gh#56. Allow specifying '%option noline' in the input file, leading to the same effect as calling flex with the command line option --noline. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/buf.c, src/main.c: Emit no #line directives if gen_line_dirs is false, resolves igh#55. There are two instances in the code which will print a #line directive to the resulting lexer, regardless of the value of gen_line_dirs. Fix them, so they also respect gen_line_dirs. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-16 Tobias Klauser <tklauser@distanz.ch> * lib/lib.c, src/gen.c, src/misc.c, src/scan.l: Converted K&R style function definitions to ANSI C style Consistently make use of the ANSI C function definition style instead of the K&R style. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Used NULL constant instead of plain integer for NULL pointer. The sparse static checker warns about using plain integer 0 as NULL pointers in the generated lexer code. Fix this by using NULL consistently for pointers. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Marked declaration and definition of yy_fatal_error as noreturn. Only the declaration of yy_fatal_error is marked with __attribute__((__noreturn__)) in case GCC >= 3 is used, but not the definition. This leads to the sparse static checker to complain about function declaration mismatch. Fix it by defining a macro yynoreturn and using it for both the declaration and the definition of yy_fatal_error. 2016-01-27 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Fixed declaration mismatch in yy_fatal_error. The prototype declares yy_fatal_error parameter as "const char msg[]" while the definition uses "const char* msg" (introduced by commit e9d5fc713f61b) which causes the sparse static checkers to produce an error. Fix this by adjusting the definition to use "const char* msg" as well. Also change the C++ version accordingly so it matches the declaration in FlexLexer.hpp. 2016-01-23 Will Estes <westes575@gmail.com> * CODE_OF_CONDUCT.md: flex is for flex #NCoC 2016-01-18 Will Estes <westes575@gmail.com> * doc/flex.texi: Referred to github for issue tracking, no longer sf 2016-01-10 Egor Pugin <egor.pugin@gmail.com> * tests/reject.l4, tests/tableopts.l4: Opened files in binary mode explicitly 2016-01-08 OBATA Akio <obache@NetBSD.org> * src/Makefile.am: Linked flex binary against libintl, not libfl. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> 2016-01-08 Michael van Elst <mlelstv@NetBSD.org> * src/filter.c: Improved pipe-stdin hack behavior; resolves sf#198. Signed-off-by: Thomas <Klausner wiz@NetBSD.org> 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac, src/flexdef.h: Removed no longer needed header checks 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac: Checked for reallocarray() with AC_REPLACE_FUNCS 2015-12-27 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: include libgen.h from flexdef.h, not main.c 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Replace basename2() with basename(3). Given the following program: \#include <libgen.h> \#include <stdio.h> /* extracts basename from path, optionally stripping the extension "\.*" * (same concept as /bin/sh `basename`, but different handling of extension). */ static char *basename2 (char *path) { char *b; for (b = path; *path; path++) if (*path == '/') b = path + 1; return b; } static void basename_compare(char *path) { printf("basename: %s\n", basename(path)); printf("basename2: %s\n\n", basename2(path)); } int main (int argc, char *argv[]) { // From http://pubs.opengroup.org/onlinepubs/9699919799/ // ``Sample Input and Output Strings'' basename_compare("/usr/lib"); basename_compare("/usr/"); basename_compare("/"); basename_compare("///"); basename_compare("//usr//lib//"); return 0; } ... and the program's output: basename: lib basename2: lib basename: usr basename2: basename: / basename2: basename: / basename2: basename: lib basename2: ... we can see that basename2() behaves the same as basename(3) in the average use case, but messes up pretty severely in others. Besides that, basename(3) is mandated by POSIX so should be present on modern Unix-like systems, so we shouldn't define it ourselves. Some notes: - it doesn't appear to be mentioned in POSIX, but OpenBSD's basename(3) returns NULL if the returned path componenet is > PATH_MAX, so add a check for that - basename(3) shouldn't return an empty string, so remove the program_name[0] != '\0' check 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Simplify basename2(). It's only call site does not activate the `strip_ext` code path, so the function can be simplified a lot. While here, remove a double assignment. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flex.skl, src/misc.c: Cleaned up __STDC__ #ifdefs. Assuming a compiler conforming to the ISO C standard is used, i.e., __STDC__ is defined to 1, YY_USE_CONST is always defined and can be eliminated. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flexdef.h, src/main.c, src/scanopt.c, src/scanopt.h, src/sym.c: Remove remaining use of PROTO 2015-12-21 Serguey Parkhomovsky <xindigo@gmail.com> * src/buf.c: buf.c: use snprintf 2015-12-19 Will Estes <westes575@gmail.com> * configure.ac: build: reformatted AC_CHECK_FUNCS for readability 2015-12-17 Will Estes <westes575@gmail.com> * src/scanopt.c: correct function prototype 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c, src/scanopt.c, src/sym.c, src/tblcmp.c: Remove more instances of PROTO 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c: Removed prototype for main(). It's not called anywhere else so the prototype is not needed. See the C99 standard [1], section 5.1.2.2.1 for more info. [1]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/dfa.c, src/gen.c, src/nfa.c, to.do/unicode/main.c, to.do/unicode/tblcmp.c: Removed more instances of PROTO, ansifying. 2015-12-13 Will Estes <westes575@gmail.com> * README: Noted github for issue tracking and pull requests 2015-12-13 Michael McConville <mmcco@mykolab.com> * README: Reformatted README; removed sf bug tracking link. 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/gen.c, to.do/unicode/gen.c: Removed macros for indentation level. Just increment or decrement the indentation counter. That's less to remember and makes the code more readable. w# Please enter the commit message for your changes. Lines starting 2015-12-12 Mike Frysinger <vapier@gentoo.org> * tests/Makefile.am, tests/testwrapper.sh: tests: fixed paths to input files. The current test wrapper works only when the inputs are specified using relative paths. If they're specified with absolute paths, the driver fails to detect the inputs because it always prepends the input dir name which itself is a relative path: $ cd tests $ ./testwrapper.sh -d . -i $PWD/reject.txt -t ./reject_ver.table <fails to open inputs> This normally doesn't show up because people run `./configure` or, for out of tree builds, `../configure`. But if you happen to run configure with an absolute path, then automake tends to generate absolute paths as well leading to test failures. Fix all of this by dropping the implicit input directory prepending. - INPUT_NAME is often a list of files, not just a single one - the input directory is used to find the testname tables which are usually generated, so it's impossible to use files from both source and build directories - most of the time, the full/correct path is already specified 2015-12-12 Mike Frysinger <vapier@gentoo.org> * configure.ac: configure: fixed realloc test. The [] characters are used for quoting in m4, so the attempt to use them in place of `test` fails yielding the warning at build time: .../flex/configure: line 20222: no: command not found 2015-12-12 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Started removal of PROTO macro. The PROTO macro is no longer needed. Additionally, its usage is inconsistent, so we began removing it. 2015-12-12 Michael Reed <m.reed@mykolab.com> * Makefile.am, src/main.c: Removed SHORT_FILE_NAMES preprocessor symbol. As a relic of MS-DOS, we don't need this. It's never defined; see 13b5b214f53d1c3354a7ab910bd160c126df1331. Removed additional MSDOS ifdef. 2015-12-11 Michael McConville <mmcco@mykolab.com> * configure.ac, lib/reallocarray.c, src/flexdef.h: Added new function reallocarray. This is taken from OpenSSH Portable, which in turn takes it from OpenBSD. reallocarray wraps the stdlib's realloc function. It takes two size arguments and checks for overflow, like calloc, but doesn't zero the memory. Therefore, it allows us to do overflow-safe array reallocations and overflow-safe unzeroed array allocations, which the stdlib allocation functions don't. We have a bunch of specific array allocation macros, none of which check for overflow. reallocarray should be able to replace them. 2015-12-11 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Removed MS-DOS, VMS macros. Given the age of the MS-DOS and VMS platforms, it's likely that no one is building flex on them any more. Additionally, the preferred approach is to test for particular platform features rather than to test for particular platforms. 2015-12-12 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: Made search for m4 more explicit. 2015-12-12 Will Estes <westes575@gmail.com> * src/flex.skl: Returned 0 from yywrap() instead of EOF 2015-12-11 Will Estes <westes575@gmail.com> * src/libmain.c: Changed end of main() in libmain to exit(0) 2015-12-11 Will Estes <westes575@gmail.com> * NEWS, configure.ac: Mentioned v2.6.1; documented some changes since v2.6.0 2015-12-11 Will Estes <westes575@gmail.com> * README: Updated build documentation; finished sf#155. Removed version numbers for build tools. Noted that version requirements for build tools will be noted in configure.ac. Expanded documentation of building texinfo based docs. 2015-12-11 Will Estes <westes575@gmail.com> * doc/Makefile.am: Removed flex.pdf from distribution; partially fixed sf#155 2015-12-11 Will Estes <westes575@gmail.com> * src/flex.skl: Commented in C style in skeleton; fixed sf#195 2015-12-10 Will Estes <westes575@gmail.com> * .gitignore: Ignored autoscan files 2015-12-09 Will Estes <westes575@gmail.com> * configure.ac: Checked for ranlib and strdup() at configure time 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/tblcmp.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/tblcmp.c: Replace zero_out() with stdlib's memset. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flex.skl: Removed memory allocation casts. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed alloca() configuration. Since alloca() is dangerous, depricated, we remove it. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed implementation of isascii(). POSIX defines isascii(), so it's likely present on anything weactually build flex on these days. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/main.c, src/scanopt.c, src/tables.c: Removed NULL-checks before free() 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/flexdef.h, src/gen.c, src/scan.l, to.do/unicode/flexdef.h, to.do/unicode/scan.l: Removed flex_free()i, corrected buf_destroy logic. As with flex_alloc(), replace with direct calls to free(). The function buf_destroy is now null safe and the logic was corrected to free() correctly. 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/filter.c, src/flexdef.h, src/misc.c, src/scan.l, src/scanflags.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_realloc(). As with flex_alloc(), replace calls to flex_realloc(), which was just a wrapper around realloc(). 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanflags.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_alloc; cleaned up style. The function flex_alloc() was just a wrapper around malloc(). Since this only added unclarity, and the flex_alloc() function is likely a legacy of olden times, remove it in favor of calls to malloc() directly. Style elements cleaned up: * superfluous spacing around parentheses * non-constant initialization in variable declarations * needless casts * almost all uses of assignments as subexpressions 2015-12-07 Michael McConville <mmcconville@mykolab.com> * src/dfa.c, src/flexdef.h, src/gen.c, src/main.c, src/scan.l, src/scanopt.c, tests/bison_nr_scanner.l, tests/bison_yylloc_scanner.l, tests/bison_yylval_scanner.l, tests/mem_nr.l, tests/mem_r.l, tests/pthread.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l, to.do/unicode/scan.l: Remove allocation casts 2015-12-07 Will Estes <westes575@gmail.com> * src/.gitignore, src/Makefile.am: Built flex with itself. Changes in scan.l need to be built into flex with the same version of flex in some cases. Since this build requirement is minimal, we simply bootstrap flex unconditionally. We intentionally exclude from version control the bootstrap artifacts as the extra copy of the lexer, the intermediate scanner and the bootstrap executable are not of interest. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, to.do/unicode/main.c, to.do/unicode/scan.l: Use NULL rather than (type *) 0. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: Replace copy_unsigned_string() with xstrdup(). Like copy_string(), copy_unsigned_string() is just a clone of the stlib's strdup(). We only use it twice. I'm pretty confident that char signedness is irrelevant in this case. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Cleaned up white space. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Removed struct keyword before yy_buffer_state 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * examples/testxxLexer.l, src/FlexLexer.h, src/flex.skl, src/main.c: Replaced FLEX_STD macro with std::. The std:: construct exists as of C++98, so we can simply assume it is supported. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/Makefile.am: Generated skel.c explicitly in srcdir. Rewrote the target for skel.c to explicitly mention the srcdir. This should help when building flex from a directory outside the flex tree. Spread the rule out over several lines to enhance readability. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * autogen.sh: Called glibtoolize if libtoolize run fails. On Mac OS X, libtoolize is known as glibtoolize. In cases where libtoolize is not present, then calling glibtoolize when bootstrapping the build system gives more folks a shot at getting flex built from the ground up. 2015-12-02 Mightyjo <mightyjo@gmail.com> * configure.ac: Checked for (g)texi2dvi. Better bison, help2man checks. Added test for presence of (g)texi2dvi program. Gave notice if texi2dvi is unavailable and set TEXI2DVI=: to avoid giving users headaches. Enhanced tests for bison and help2man with notices when the programs aren't found. Set their program variables to use the missing script in build-aux since it's compatible with them. 2015-12-02 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/parse.y, src/scan.l, src/sym.c, src/tables.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Made string copying more standard. copy_string() was a clone of the stdlib's strdup(). For safety, simplicity, and speed, we should use that instead. We introduce xstrdup() which wraps strdup() in a failure upon memory allocation errors. 2015-11-30 Serguey Parkhomovsky <sergueyparkhomovsky@gmail.com> * src/scan.l: Error on unbalanced parentheses in rules section. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Cleaned up BUILT_SOURCES list. Removed reference to skel.c as a built source since other make rules cover this case. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Sorted file names in flex_SOURCES 2015-11-27 Mightyjo <mightyjo@gmail.com> * src/ecs.c, src/flexdef.h, src/main.c, src/misc.c, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Replaced CHAR macro with unsigned char type. Thanks to Michael McConville for pointing out that the old Char macro causes problems with static analysis. The macro has been removed and replaced with 'unsigned char' throughout the flex sources. The macro is not needed at best and was confusing at worst. It was not used in any of the example files nor was it mentioned in the manual at all. 2015-11-21 Will Estes <westes575@gmail.com> * configure.ac: updated syntax of AC_INIT call as per autoupdate 2015-11-21 Will Estes <westes575@gmail.com> * tests/Makefile.am: removed extra call to a _CPPFLAGS variable 2015-05-14 Stefan Reinauer <stefan.reinauer@coreboot.org> * src/buf.c, src/ccl.c, src/dfa.c, src/ecs.c, src/gen.c, src/main.c, src/misc.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Switch function definitions from mixed K&R to consistent ANSI C. flex was using K&R function definitions for some functions and ANSI C style in others, sometimes even in the same file. Change the code to consistently use ANSI C. Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> 2015-11-16 Mightyjo <mightyjo@gmail.com> * tests/Makefile.am: Used in-tree header file for c++ tests.
2017-01-02 19:26:30 +03:00
main (void)
2016-01-09 18:43:18 +03:00
{
char * buf;
2016-12-30 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS for 2.6.3 release 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: New configure option '--disable-bootstrap'. If configure is run with '--disable-bootstrap', then stage1flex won't be built and stage1scan.c will be generated by sed'ing scan.c. This option is intended to workaround bootstrap bugs rather than to fix the bootstrapping issues which are proving subtler and harder to fix than anyone would like. 2016-11-26 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: "make clean" deletes stage1scan.c, stage1flex 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: allow building libfl even with --disable-libfl. For various reasons, we may wish to build libfl explicitly even when configure has been run with the --disable-libfl option. This is possible, now, via 'make -C src libfl.la'. 2016-12-19 Alexis La Goutte <alexis.lagoutte@gmail.com> * src/flex.skl: scanner: remove trailing whitespace in skeleton 2016-12-01 Demi Obenour <demiobenour@gmail.com> * src/buf.c, src/main.c, src/parse.y: scanner: Disallow, overquote '[' and ']' in prefix 2016-12-29 Samuel Thibault <samuel.thibault@ens-lyon.org> * src/main.c: scanner: allocate correct buffer size for m4 path. Flex did not check the length of the m4 path which could lead to a buffer overflow in some cases. Additionally, not all platforms believe in PATH_MAX, so stop relying on it. Fixes #138 2016-11-24 Will Estes <westes575@gmail.com> * NEWS: doc: note no more libcompat in NEWS 2016-11-24 Will Estes <westes575@gmail.com> * lib/Makefile.am: build: explain empty lib/Makefile.am 2016-11-20 Explorer09 <explorer09@gmail.com> * configure.ac: build: warn about cross compiling with *alloc 2016-11-19 Explorer09 <explorer09@gmail.com> * configure.ac, lib/Makefile.am, lib/lib.c, src/Makefile.am: build: Link $(LIBOBJS) from src/ dir, remove libcompat.la. The libcompat.la library was small and less friendly to bootstrapping and cross compilation. Now, we will simply link individual object files as needed, which is simpler. 2016-11-16 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: Let stage1flex respect LFLAGS 2016-11-14 Will Estes <westes575@gmail.com> * NEWS: doc: describe --disable-libfl in NEWS 2016-10-31 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: Add --disable-libfl configure option. Disabling libfl is useful when building flex for a cross-toolchain. Fixes: GH-99 2016-11-09 Demi Obenour <demiobenour@gmail.com> * src/flex.skl, tests/array_r.l: fix backwards incompatible changes in 2.6.2. This patch addscompatibility `#defines` for all macros affected by `%prefix`. Fixes #113. 2016-11-08 Will Estes <westes575@gmail.com> * tests/.gitignore: git: ignore quote_in_comment artifacts 2016-11-08 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/Makefile.am, tests/quote_in_comment.l, tests/quote_in_comment.txt: Fixes a major bug in Flex's own lexing of literals. My changes caused Flex to mishandle string and character literals in line comments. This commit fixes them. Fixes #113. 2016-11-06 Thomas Klausner <wiz@NetBSD.org> * configure.ac: Fix unportable test(1) operator. "==" is only supported by bash, "=" is the standard comparison operator. 2016-11-02 Demi Obenour <demiobenour@gmail.com> * tests/quotes.l: Add more escaping tests 2016-11-01 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix another escaping bug in non-indented verbatim section 2 code. I also did some reformatting. 2016-10-28 Alastair Hughes <hobbitalastair@gmail.com> * configure.ac: build: fix false negatives for help2man and texi2dvi HELP2MAN and TEXI2DVI (or the corresponding ac_prog variables) will never be zero length as they fall back to the missing script; check for the fall back and warn on that instead of always warning. 2016-10-28 Explorer09 <explorer09@gmail.com> * doc/Makefile.am: doc: Don't delete flex.1 during "make distclean". flex.1 is pre-generated in release tarball. If we delete it, the next "configure and make" on the source directory will then require help2man unnecessarily. 2016-10-27 Alastair Hughes <hobbitalastair@gmail.com> * NEWS, doc/Makefile.am: Only regenerate the man page when required. Make the flex binary an order-only prerequisite, and add back the prerequisites from before 7cfb440. This prevents rebuilding the man page whenever the flex binary is rebuilt, which causes problems if help2man is not installed and will never work when cross compiling. Fixes #108. 2016-10-26 Will Estes <westes575@gmail.com> * NEWS, src/Makefile.am: build: no longer build PIC version of libfl. The PIC version of libfl was not being built correctly. From the lack of bug reports around this problem, we conclude that the PIC version of libfl is not used and so we drop it from the build build targets for flex. 2016-10-25 Explorer09 <explorer09@gmail.com> * README.md: doc: README.md formatting fixes * Wrap everything in the raw document in 72 char per line limit. * Proper casing for terms "Git" and "GitHub" (don't try to look lazy). * Add unordered list marks when needed. * Say `configure && make && make install` and quoted for fixed-width font. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> 2016-10-25 Will Estes <westes575@gmail.com> * NEWS, configure.ac: build: version 2.6.3 begins 2016-10-24 Will Estes <westes575@gmail.com> * NEWS: doc: mark 2.6.2 release date 2016-10-24 Will Estes <westes575@gmail.com> * .gitignore, NEWS, configure.ac: build: switch xz to lzip 2016-10-20 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/quotes.l: Fix M4 quotation in section 2 prologue and refactor duplicated code 2016-10-21 Alex Kennedy <alexzanderkennedy@gmail.com> * doc/flex.texi: Update flex.texi: Removed repedative wording "Flex used to" was written twice at the beginning of Chapter 9, paragraph 2. 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/dfa.c, src/gen.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, tests/bison_yylval_scanner.l, tests/include_by_push.direct.l: Improved M4 quotation This fixes M4 quotation of certain strings beginning with `yy` (in section 3 of the input file only) and character literals. The new quotation method is also less brittle and faster. Tests that relied on the old behavior were fixed. Also, `yyconst` is no longer defined; use `const` (which it unconditionally was defined to) instead. 2016-10-19 Will Estes <westes575@gmail.com> * Makefile.am, configure.ac: build: for automake, flex is foreign 2016-10-19 Will Estes <westes575@gmail.com> * README, README.md: doc: mv README to README.md 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: touch up README 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: README no longer mentions sourceforge 2016-10-06 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS with more post-2.6.1 additions 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/options.c, src/options.h, src/scan.l, src/yylex.c, tests/Makefile.am, tests/alloc_extra.l, tests/array_r.l, tests/basic_r.l, tests/c_cxx_nr.lll, tests/c_cxx_r.lll, tests/debug_r.l, tests/include_by_reentrant.direct.l, tests/lineno_r.l, tests/mem_nr.l, tests/mem_r.l, tests/posix.l, tests/posixly_correct.l, tests/pthread.l, tests/quotes.l, tests/reject.l4, tests/rescan_nr.direct.l, tests/rescan_r.direct.l, tests/string_nr.l, tests/string_r.l: Fix M4 quoting of section 3. This fixes M4 quoting of section 3 of the input file, including escape sequences and character constants. Tests were added to verify the behavior in section 3 with respect to quoting. Both escaping of quotes and quoting of potential macro-start characters are tested. Existing tests were also fixed to account for the new -- and now correct -- behavior. Many tests relied on the old behavior of expanding M4 macros in section 3. They needed to be updated for the new behavior. 2016-10-03 Mightyjo <mightyjo@gmail.com> * src/flex.skl, tests/.gitignore, tests/Makefile.am, tests/cxx_restart.ll, tests/cxx_restart.txt: Fix yyrestart(NULL) SEGV. 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/scan.l: scanner: M4 quoting fixes 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am: Support `make indent` for out of source builds 2016-09-24 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am, src/mkskel.sh: Simplify some shell code 2016-09-23 Demi Obenour <demiobenour@gmail.com> * doc/flex.texi, src/flex.skl, src/flexdef.h, src/main.c, src/options.c, src/options.h, src/scan.l, tests/.gitignore, tests/Makefile.am, tests/noansi_nr.l, tests/noansi_nr.txt, tests/noansi_r.l, tests/noansi_r.txt: no longer generate K&R C scanners 2016-09-04 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix escaping of `[[` and `]]` in strings Previously, `[[` and `]]` were not escaped in strings, which led to bad interactions with m4. Also, don't break strings on newline, as GCC et al support whitespace between a backslash and the subsequent newline. 2016-06-20 Translation Project <coordinator@translationproject.org> * NEWS, po/sv.po: new sv translation 2016-05-23 Demetri Obenour <demiobenour@gmail.com> * src/misc.c: Delete action_m4_define from misc.c This function was not used and always triggered a fatal error when run. 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am, tests/testwrapper-direct.sh: test: run direct tests from srcdir 2016-01-11 Egor Pugin <egor.pugin@gmail.com> * tests/include_by_buffer.direct.l, tests/include_by_push.direct.l, tests/include_by_reentrant.direct.l: Exited with error code on some conditions in include tests 2016-05-20 Will Estes <westes575@gmail.com> * tests/testwrapper.sh: test: drop .exe when making input file names 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am: test: removed dependencies for include tests 2016-04-28 Tobias Klauser <tklauser@distanz.ch> * src/scanflags.c: Avoid realloc on every call of sf_push() Currently, every call to sf_push() realloc()'s _sf_stack, even if the maximum size _sf_max wasn't changed. As the indentation beneath the "if" clause already indicates, the realloc() should only be executed if _sf_max was increased. Found by compiling flex with the -Wmisleading-indentation flags of gcc, which leads to the following warning: scanflags.c: In function ‘sf_push’: scanflags.c:42:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (_sf_top_ix + 1 >= _sf_max) ^~ scanflags.c:44:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ _sf_stk = realloc(_sf_stk, sizeof(scanflags_t) * _sf_max); ^~~~~~~ 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: prettified command to build man page 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: added man page to DISTCLEANFILES 2016-03-31 Will Estes <westes575@gmail.com> * BUGS, TODO: remove unused TODO, BUGS files 2016-03-31 Will Estes <westes575@gmail.com> * to.do/README, to.do/Wilhelms.todo, to.do/Wish-List, to.do/flex.rmail, to.do/streams.mail, to.do/unicode/FlexLexer.h, to.do/unicode/ccl.c, to.do/unicode/changes.txt, to.do/unicode/ecs.c, to.do/unicode/flex.1, to.do/unicode/flex.skl, to.do/unicode/flexdef.h, to.do/unicode/gen.c, to.do/unicode/main.c, to.do/unicode/misc.c, to.do/unicode/scan.l, to.do/unicode/tblcmp.c: removed to.do/ directory 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: removed flex.skl from POTFILES.in file list 2016-03-31 rlar <rlar> * src/Makefile.am: fix skel.c dependency (missing tables_shared.c) and polish build rule Also remove references to srcdir since skel.c is no longer mentioned in po/POTFILES.in. 2016-03-31 rlar <rlar> * doc/Makefile.am: fix flex.1 dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 && \ make dist failed with: > help2man: can't get `--help' info from ../../flex/src/flex Note: There is no dependency except for the flex binary. 2016-03-31 rlar <rlar> * src/Makefile.am: fix stage1scan.c and stage1scan.l dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 failed with: > ../src/stage1flex -o stage1scan.c stage1scan.l > stage1flex: can't open stage1scan.l Note: stage1scan.c is not necessairy in the "make dist" generated tar.gz file. stage1flex will be build from scan.c (which is distributed), and this will then generate stage1scan.c from scan.l 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: list src/flex.skl in po/POTFILES.in 2016-03-29 rlar <rlar> * src/gen.c: warning in generated code, with -Ca warning: conversion to 'yy_state_type' from 'flex_uint32_t' may change the sign of the result [-Wsign-conversion] 2016-03-29 rlar <rlar> * tests/Makefile.am: suppress `WARNINGFLAGS' for the almost obsolete `noansi' test cases 2016-03-29 rlar <rlar> * configure.ac, src/Makefile.am, tests/Makefile.am: configure option `--enable-warnings' and `WARNINGFLAGS' `WARNINGFLAGS' can be passed when invoking `configure' and when invoking `make' if configure switch `--enable-warnings' was given then default to something useful if we have `GCC' `WARNINGFLAGS' is not used when compiling `stage1flex' to avoid unnecessary clutter 2016-03-31 Tobias Klauser <tklauser@distanz.ch> * src/main.c: Fix potential buffer overflow in strncat() When using clang/llvm 3.8 to compile flex, the following warning is emitted: main.c:378:27: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size] strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ main.c:378:27: note: change the argument to be the free space in the destination buffer minus the terminating null byte strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ sizeof(m4_path) - strlen(m4_path) - 1Fix it up by using the solution proposed by the warning message. 2016-03-29 Robert.Larice Robert Larice <Robert.Larice@t-online.de> * src/Makefile.am: build: simplified dependency tracking so parallel make runs succeed 2016-03-20 rlar <rlar> * src/flex.skl, src/gen.c, src/main.c: avoid warning in generated code, with -Cf warning: conversion to 'unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-18 Will Estes <westes575@gmail.com> * NEWS, configure.ac: mention v2.6.2; summarize changes since 2.6.1 2016-03-18 Will Estes <westes575@gmail.com> * doc/flex.texi: doc: corrected example in manual, gh#67 2016-03-16 rlar <rlar> * tests/string_nr.l, tests/string_r.l, tests/yyextra.l: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * tests/mem_nr.l, tests/mem_r.l, tests/pthread.l: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * src/flex.skl: warning: conversion to 'flex_uint32_t' from 'long unsigned int' may alter its value [-Wconversion] struct yytbl_reader, member bread is of type flex_uint32_t 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/bison_nr_main.c, tests/bison_nr_parser.y, tests/bison_yylloc_parser.y: warning: redundant redeclaration of '...' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/bison_nr_parser.y, tests/bison_yylloc_parser.y, tests/bison_yylval_parser.y, tests/pthread.l: warning: no previous prototype for '...' [-Wmissing-prototypes] 2016-03-16 rlar <rlar> * tests/multiple_scanners_r_main.c: warning: unused variable 'fp' [-Wunused-variable] 2016-03-16 rlar <rlar> * tests/pthread.l: main(), warning: redundant redeclaration of 'main' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/include_by_reentrant.direct.l, tests/lineno_nr.l, tests/lineno_r.l, tests/lineno_trailing.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/array_nr.l, tests/array_r.l, tests/basic_nr.l, tests/basic_r.l, tests/ccl.l, tests/debug_nr.l, tests/debug_r.l, tests/extended.l, tests/mem_nr.l, tests/mem_r.l, tests/noansi_r.l, tests/posix.l, tests/posixly_correct.l, tests/prefix_nr.l, tests/prefix_r.l, tests/quotes.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-01 rlar <rlar> * src/ecs.c, src/tblcmp.c: Fix two more casts 2016-03-14 Bastian Köcher <git@kchr.de> * src/gen.c: Fixes yyl compare with unsigned warning 2016-03-13 Robert Larice <Robert.Larice@t-online.de> * configure.ac: Suppress portability warnings in Makefile generation 2016-02-27 rlar <rlar> * src/flex.skl: generated code, in yyensure_buffer_stack(), change type of local `num_to_alloc' which is exclusively used in yy_size_t context 2016-03-01 rlar <rlar> * src/flex.skl: generated code, in yy_get_next_buffer(), change type of local `number_to_move' suits better, because `yy_n_chars' and `yy_buf_size' are of type `int' 2016-02-27 rlar <rlar> * src/flex.skl: generated code, `_yybytes_len' is of type `int', fix code accordingly 2016-02-28 rlar <rlar> * src/gen.c: generated code, `max_size' seems to be of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, here `new_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `yy_buf_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `offset' is of type `int' 2016-02-28 rlar <rlar> * src/gen.c: generated code, `yy_more_len' is of type `int' 2016-02-28 rlar <rlar> * src/scan.l: scan.l, rewrite two loops to avoid unneccesairy casting 2016-03-01 rlar <rlar> * src/regex.c, src/tables.c: improve readability 2016-02-28 rlar <rlar> * src/tblcmp.c: another cast in tblcmp.c to avoid warning 2016-02-28 rlar <rlar> * src/buf.c: casts in buf_append() to get rid of warnings 2016-02-28 rlar <rlar> * src/dfa.c, src/gen.c: cast to suite type of flex_uint32_t td_lolen 2016-02-28 rlar <rlar> * src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanopt.c, src/tables_shared.c: cast to get rid of warnings 2016-03-01 rlar <rlar> * src/buf.c, src/main.c: cast and fix usage of log10(), ceil to prevent buffer overflow 2016-03-01 rlar <rlar> * src/tables.c: tables.c, sprinkle casts to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_data_compress(), change type of local newsz to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c, src/tables.h: change type of struct yytbl_writer.total_written to get rid of warnings 2016-02-28 rlar <rlar> * src/tables.c: change argument type of yytbl_writen() to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_write8/16/32(), change type of local variables to get rid of warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/misc.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: change return type and rename int htoi()/otoi() --> unsigned int htoui()/otoui() 2016-03-01 Will Estes <westes575@gmail.com> * NEWS: Mention 2.6.1 release date 2016-02-28 rlar <rlar> * src/gen.c: avoid warning, add (int) cast to the read() return value For similiarity with the fread() case. 2016-02-28 rlar <rlar> * src/scan.l: avoid warning, POSIX says yyless() has an `int' argument 2016-02-29 rlar <rlar> * src/filter.c: use type size_t in filter_tee_header() to avoid warnings 2016-02-29 rlar <rlar> * src/filter.c, src/misc.c, src/scanopt.c, src/tables.c: add (size_t) casts to malloc invocations to prevent warnings 2016-02-29 rlar <rlar> * src/buf.c, src/misc.c, src/scan.l, src/scanopt.c, src/tables.c: add (int) casts to some strlen() invocations to prevent warnings 2016-02-29 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndlookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndinstal(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: cclinstal() and ccllookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/gen.c: warning: redundant redeclaration of ‘gen_next_state’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/gen.c: warning: no previous prototype for ‘mkecstbl’ [-Wmissing-prototypes] 2016-02-28 rlar <rlar> * src/main.c: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yywrap’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yylval’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yyin’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h, src/main.c: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: unification, rename some more rename these too for improved similiarity: OPTION_OP OPT_HEADER OPT_EXTRA_TYPE OPT_TABLES 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: fix name clash, OPT_OUTFILE from parse.y and from options.h these collide: OPT_OUTFILE OPT_PREFIX OPT_YYCLASS rename them TOK_... in the parser 2016-02-28 Will Estes <westes575@gmail.com> * lib/reallocarray.c: Prototyped reallocarray implementation 2016-02-28 Will Estes <westes575@gmail.com> * src/scanopt.c: Removed custom strcasecmp() function 2016-02-28 rlar <rlar> * src/flex.skl: fwrite wants a size_t, yyleng is int per posix 2016-02-28 rlar <rlar> * src/scanopt.c: Remove some unneeded casts 2016-02-28 rlar <rlar> * src/flexdef.h: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion] 2016-02-27 rlar <rlar> * src/dfa.c, src/parse.y: dfa.c:157:24: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] most certainly safe cast 2016-02-27 rlar <rlar> * src/ccl.c: ccl.c:86:19: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion] ch seems to have been checked for proper range some lines above 2016-02-27 rlar <rlar> * tests/bison_nr_parser.y: warning: deprecated directive, use '%pure-parser' [-Wdeprecated] 2016-02-27 rlar <rlar> * lib/lib.c: warning: no previous prototype for 'do_nothing' [-Wmissing-prototypes] 2016-02-27 rlar <rlar> * src/libmain.c: included stdlib.h header 2016-02-27 Will Estes <westes575@gmail.com> * NEWS: Described more post v2.6.0 changes 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: build: Removed bzip2 distribiution archive 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: removed obsolete program check 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: Made some program checks more robust 2016-02-27 rlar <rlar> * src/flex.skl: Remove unneeded cast to int 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fixed incorrect integer type 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fix more integer types, resolves sf 184, 187 2016-02-26 Robert Larice <Robert.Larice@t-online.de> * src/flex.skl, src/gen.c: Removed some type conversion warnings 2016-02-26 Will Estes <westes575@gmail.com> * src/flex.skl: Changed another buffer size to int; resolves gh#61 2016-02-24 Will Estes <westes575@gmail.com> * src/flex.skl: Changed type of yy_n_chars to int; gh#53, sf#160. The variable yy_n_chars had been of type yy_size_t which is incorrect given its use in read(). While it might be adviseable to look at defining a yy_ssize_t, there might be some issues doing this and so, for now, at least, we'll punt back to int. 2016-02-24 Will Estes <westes575@gmail.com> * src/buf.c: Fixed size of bufferallocation, resolved gh#54. The value of n_alloc was a count, not a size. Multiplying the value by the element size was incorrect. That multiplication was already being done and having it done twice was incorrect. 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/scan.l: Allow '%option noline' in flex input file, resolves gh#56. Allow specifying '%option noline' in the input file, leading to the same effect as calling flex with the command line option --noline. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/buf.c, src/main.c: Emit no #line directives if gen_line_dirs is false, resolves igh#55. There are two instances in the code which will print a #line directive to the resulting lexer, regardless of the value of gen_line_dirs. Fix them, so they also respect gen_line_dirs. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-16 Tobias Klauser <tklauser@distanz.ch> * lib/lib.c, src/gen.c, src/misc.c, src/scan.l: Converted K&R style function definitions to ANSI C style Consistently make use of the ANSI C function definition style instead of the K&R style. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Used NULL constant instead of plain integer for NULL pointer. The sparse static checker warns about using plain integer 0 as NULL pointers in the generated lexer code. Fix this by using NULL consistently for pointers. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Marked declaration and definition of yy_fatal_error as noreturn. Only the declaration of yy_fatal_error is marked with __attribute__((__noreturn__)) in case GCC >= 3 is used, but not the definition. This leads to the sparse static checker to complain about function declaration mismatch. Fix it by defining a macro yynoreturn and using it for both the declaration and the definition of yy_fatal_error. 2016-01-27 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Fixed declaration mismatch in yy_fatal_error. The prototype declares yy_fatal_error parameter as "const char msg[]" while the definition uses "const char* msg" (introduced by commit e9d5fc713f61b) which causes the sparse static checkers to produce an error. Fix this by adjusting the definition to use "const char* msg" as well. Also change the C++ version accordingly so it matches the declaration in FlexLexer.hpp. 2016-01-23 Will Estes <westes575@gmail.com> * CODE_OF_CONDUCT.md: flex is for flex #NCoC 2016-01-18 Will Estes <westes575@gmail.com> * doc/flex.texi: Referred to github for issue tracking, no longer sf 2016-01-10 Egor Pugin <egor.pugin@gmail.com> * tests/reject.l4, tests/tableopts.l4: Opened files in binary mode explicitly 2016-01-08 OBATA Akio <obache@NetBSD.org> * src/Makefile.am: Linked flex binary against libintl, not libfl. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> 2016-01-08 Michael van Elst <mlelstv@NetBSD.org> * src/filter.c: Improved pipe-stdin hack behavior; resolves sf#198. Signed-off-by: Thomas <Klausner wiz@NetBSD.org> 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac, src/flexdef.h: Removed no longer needed header checks 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac: Checked for reallocarray() with AC_REPLACE_FUNCS 2015-12-27 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: include libgen.h from flexdef.h, not main.c 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Replace basename2() with basename(3). Given the following program: \#include <libgen.h> \#include <stdio.h> /* extracts basename from path, optionally stripping the extension "\.*" * (same concept as /bin/sh `basename`, but different handling of extension). */ static char *basename2 (char *path) { char *b; for (b = path; *path; path++) if (*path == '/') b = path + 1; return b; } static void basename_compare(char *path) { printf("basename: %s\n", basename(path)); printf("basename2: %s\n\n", basename2(path)); } int main (int argc, char *argv[]) { // From http://pubs.opengroup.org/onlinepubs/9699919799/ // ``Sample Input and Output Strings'' basename_compare("/usr/lib"); basename_compare("/usr/"); basename_compare("/"); basename_compare("///"); basename_compare("//usr//lib//"); return 0; } ... and the program's output: basename: lib basename2: lib basename: usr basename2: basename: / basename2: basename: / basename2: basename: lib basename2: ... we can see that basename2() behaves the same as basename(3) in the average use case, but messes up pretty severely in others. Besides that, basename(3) is mandated by POSIX so should be present on modern Unix-like systems, so we shouldn't define it ourselves. Some notes: - it doesn't appear to be mentioned in POSIX, but OpenBSD's basename(3) returns NULL if the returned path componenet is > PATH_MAX, so add a check for that - basename(3) shouldn't return an empty string, so remove the program_name[0] != '\0' check 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Simplify basename2(). It's only call site does not activate the `strip_ext` code path, so the function can be simplified a lot. While here, remove a double assignment. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flex.skl, src/misc.c: Cleaned up __STDC__ #ifdefs. Assuming a compiler conforming to the ISO C standard is used, i.e., __STDC__ is defined to 1, YY_USE_CONST is always defined and can be eliminated. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flexdef.h, src/main.c, src/scanopt.c, src/scanopt.h, src/sym.c: Remove remaining use of PROTO 2015-12-21 Serguey Parkhomovsky <xindigo@gmail.com> * src/buf.c: buf.c: use snprintf 2015-12-19 Will Estes <westes575@gmail.com> * configure.ac: build: reformatted AC_CHECK_FUNCS for readability 2015-12-17 Will Estes <westes575@gmail.com> * src/scanopt.c: correct function prototype 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c, src/scanopt.c, src/sym.c, src/tblcmp.c: Remove more instances of PROTO 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c: Removed prototype for main(). It's not called anywhere else so the prototype is not needed. See the C99 standard [1], section 5.1.2.2.1 for more info. [1]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/dfa.c, src/gen.c, src/nfa.c, to.do/unicode/main.c, to.do/unicode/tblcmp.c: Removed more instances of PROTO, ansifying. 2015-12-13 Will Estes <westes575@gmail.com> * README: Noted github for issue tracking and pull requests 2015-12-13 Michael McConville <mmcco@mykolab.com> * README: Reformatted README; removed sf bug tracking link. 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/gen.c, to.do/unicode/gen.c: Removed macros for indentation level. Just increment or decrement the indentation counter. That's less to remember and makes the code more readable. w# Please enter the commit message for your changes. Lines starting 2015-12-12 Mike Frysinger <vapier@gentoo.org> * tests/Makefile.am, tests/testwrapper.sh: tests: fixed paths to input files. The current test wrapper works only when the inputs are specified using relative paths. If they're specified with absolute paths, the driver fails to detect the inputs because it always prepends the input dir name which itself is a relative path: $ cd tests $ ./testwrapper.sh -d . -i $PWD/reject.txt -t ./reject_ver.table <fails to open inputs> This normally doesn't show up because people run `./configure` or, for out of tree builds, `../configure`. But if you happen to run configure with an absolute path, then automake tends to generate absolute paths as well leading to test failures. Fix all of this by dropping the implicit input directory prepending. - INPUT_NAME is often a list of files, not just a single one - the input directory is used to find the testname tables which are usually generated, so it's impossible to use files from both source and build directories - most of the time, the full/correct path is already specified 2015-12-12 Mike Frysinger <vapier@gentoo.org> * configure.ac: configure: fixed realloc test. The [] characters are used for quoting in m4, so the attempt to use them in place of `test` fails yielding the warning at build time: .../flex/configure: line 20222: no: command not found 2015-12-12 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Started removal of PROTO macro. The PROTO macro is no longer needed. Additionally, its usage is inconsistent, so we began removing it. 2015-12-12 Michael Reed <m.reed@mykolab.com> * Makefile.am, src/main.c: Removed SHORT_FILE_NAMES preprocessor symbol. As a relic of MS-DOS, we don't need this. It's never defined; see 13b5b214f53d1c3354a7ab910bd160c126df1331. Removed additional MSDOS ifdef. 2015-12-11 Michael McConville <mmcco@mykolab.com> * configure.ac, lib/reallocarray.c, src/flexdef.h: Added new function reallocarray. This is taken from OpenSSH Portable, which in turn takes it from OpenBSD. reallocarray wraps the stdlib's realloc function. It takes two size arguments and checks for overflow, like calloc, but doesn't zero the memory. Therefore, it allows us to do overflow-safe array reallocations and overflow-safe unzeroed array allocations, which the stdlib allocation functions don't. We have a bunch of specific array allocation macros, none of which check for overflow. reallocarray should be able to replace them. 2015-12-11 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Removed MS-DOS, VMS macros. Given the age of the MS-DOS and VMS platforms, it's likely that no one is building flex on them any more. Additionally, the preferred approach is to test for particular platform features rather than to test for particular platforms. 2015-12-12 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: Made search for m4 more explicit. 2015-12-12 Will Estes <westes575@gmail.com> * src/flex.skl: Returned 0 from yywrap() instead of EOF 2015-12-11 Will Estes <westes575@gmail.com> * src/libmain.c: Changed end of main() in libmain to exit(0) 2015-12-11 Will Estes <westes575@gmail.com> * NEWS, configure.ac: Mentioned v2.6.1; documented some changes since v2.6.0 2015-12-11 Will Estes <westes575@gmail.com> * README: Updated build documentation; finished sf#155. Removed version numbers for build tools. Noted that version requirements for build tools will be noted in configure.ac. Expanded documentation of building texinfo based docs. 2015-12-11 Will Estes <westes575@gmail.com> * doc/Makefile.am: Removed flex.pdf from distribution; partially fixed sf#155 2015-12-11 Will Estes <westes575@gmail.com> * src/flex.skl: Commented in C style in skeleton; fixed sf#195 2015-12-10 Will Estes <westes575@gmail.com> * .gitignore: Ignored autoscan files 2015-12-09 Will Estes <westes575@gmail.com> * configure.ac: Checked for ranlib and strdup() at configure time 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/tblcmp.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/tblcmp.c: Replace zero_out() with stdlib's memset. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flex.skl: Removed memory allocation casts. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed alloca() configuration. Since alloca() is dangerous, depricated, we remove it. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed implementation of isascii(). POSIX defines isascii(), so it's likely present on anything weactually build flex on these days. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/main.c, src/scanopt.c, src/tables.c: Removed NULL-checks before free() 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/flexdef.h, src/gen.c, src/scan.l, to.do/unicode/flexdef.h, to.do/unicode/scan.l: Removed flex_free()i, corrected buf_destroy logic. As with flex_alloc(), replace with direct calls to free(). The function buf_destroy is now null safe and the logic was corrected to free() correctly. 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/filter.c, src/flexdef.h, src/misc.c, src/scan.l, src/scanflags.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_realloc(). As with flex_alloc(), replace calls to flex_realloc(), which was just a wrapper around realloc(). 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanflags.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_alloc; cleaned up style. The function flex_alloc() was just a wrapper around malloc(). Since this only added unclarity, and the flex_alloc() function is likely a legacy of olden times, remove it in favor of calls to malloc() directly. Style elements cleaned up: * superfluous spacing around parentheses * non-constant initialization in variable declarations * needless casts * almost all uses of assignments as subexpressions 2015-12-07 Michael McConville <mmcconville@mykolab.com> * src/dfa.c, src/flexdef.h, src/gen.c, src/main.c, src/scan.l, src/scanopt.c, tests/bison_nr_scanner.l, tests/bison_yylloc_scanner.l, tests/bison_yylval_scanner.l, tests/mem_nr.l, tests/mem_r.l, tests/pthread.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l, to.do/unicode/scan.l: Remove allocation casts 2015-12-07 Will Estes <westes575@gmail.com> * src/.gitignore, src/Makefile.am: Built flex with itself. Changes in scan.l need to be built into flex with the same version of flex in some cases. Since this build requirement is minimal, we simply bootstrap flex unconditionally. We intentionally exclude from version control the bootstrap artifacts as the extra copy of the lexer, the intermediate scanner and the bootstrap executable are not of interest. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, to.do/unicode/main.c, to.do/unicode/scan.l: Use NULL rather than (type *) 0. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: Replace copy_unsigned_string() with xstrdup(). Like copy_string(), copy_unsigned_string() is just a clone of the stlib's strdup(). We only use it twice. I'm pretty confident that char signedness is irrelevant in this case. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Cleaned up white space. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Removed struct keyword before yy_buffer_state 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * examples/testxxLexer.l, src/FlexLexer.h, src/flex.skl, src/main.c: Replaced FLEX_STD macro with std::. The std:: construct exists as of C++98, so we can simply assume it is supported. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/Makefile.am: Generated skel.c explicitly in srcdir. Rewrote the target for skel.c to explicitly mention the srcdir. This should help when building flex from a directory outside the flex tree. Spread the rule out over several lines to enhance readability. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * autogen.sh: Called glibtoolize if libtoolize run fails. On Mac OS X, libtoolize is known as glibtoolize. In cases where libtoolize is not present, then calling glibtoolize when bootstrapping the build system gives more folks a shot at getting flex built from the ground up. 2015-12-02 Mightyjo <mightyjo@gmail.com> * configure.ac: Checked for (g)texi2dvi. Better bison, help2man checks. Added test for presence of (g)texi2dvi program. Gave notice if texi2dvi is unavailable and set TEXI2DVI=: to avoid giving users headaches. Enhanced tests for bison and help2man with notices when the programs aren't found. Set their program variables to use the missing script in build-aux since it's compatible with them. 2015-12-02 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/parse.y, src/scan.l, src/sym.c, src/tables.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Made string copying more standard. copy_string() was a clone of the stdlib's strdup(). For safety, simplicity, and speed, we should use that instead. We introduce xstrdup() which wraps strdup() in a failure upon memory allocation errors. 2015-11-30 Serguey Parkhomovsky <sergueyparkhomovsky@gmail.com> * src/scan.l: Error on unbalanced parentheses in rules section. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Cleaned up BUILT_SOURCES list. Removed reference to skel.c as a built source since other make rules cover this case. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Sorted file names in flex_SOURCES 2015-11-27 Mightyjo <mightyjo@gmail.com> * src/ecs.c, src/flexdef.h, src/main.c, src/misc.c, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Replaced CHAR macro with unsigned char type. Thanks to Michael McConville for pointing out that the old Char macro causes problems with static analysis. The macro has been removed and replaced with 'unsigned char' throughout the flex sources. The macro is not needed at best and was confusing at worst. It was not used in any of the example files nor was it mentioned in the manual at all. 2015-11-21 Will Estes <westes575@gmail.com> * configure.ac: updated syntax of AC_INIT call as per autoupdate 2015-11-21 Will Estes <westes575@gmail.com> * tests/Makefile.am: removed extra call to a _CPPFLAGS variable 2015-05-14 Stefan Reinauer <stefan.reinauer@coreboot.org> * src/buf.c, src/ccl.c, src/dfa.c, src/ecs.c, src/gen.c, src/main.c, src/misc.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Switch function definitions from mixed K&R to consistent ANSI C. flex was using K&R function definitions for some functions and ANSI C style in others, sometimes even in the same file. Change the code to consistently use ANSI C. Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> 2015-11-16 Mightyjo <mightyjo@gmail.com> * tests/Makefile.am: Used in-tree header file for c++ tests.
2017-01-02 19:26:30 +03:00
size_t len;
2016-01-09 18:43:18 +03:00
YY_BUFFER_STATE state;
yyscan_t scanner=NULL;
/* Scan a good string. */
2016-12-30 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS for 2.6.3 release 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: New configure option '--disable-bootstrap'. If configure is run with '--disable-bootstrap', then stage1flex won't be built and stage1scan.c will be generated by sed'ing scan.c. This option is intended to workaround bootstrap bugs rather than to fix the bootstrapping issues which are proving subtler and harder to fix than anyone would like. 2016-11-26 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: "make clean" deletes stage1scan.c, stage1flex 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: allow building libfl even with --disable-libfl. For various reasons, we may wish to build libfl explicitly even when configure has been run with the --disable-libfl option. This is possible, now, via 'make -C src libfl.la'. 2016-12-19 Alexis La Goutte <alexis.lagoutte@gmail.com> * src/flex.skl: scanner: remove trailing whitespace in skeleton 2016-12-01 Demi Obenour <demiobenour@gmail.com> * src/buf.c, src/main.c, src/parse.y: scanner: Disallow, overquote '[' and ']' in prefix 2016-12-29 Samuel Thibault <samuel.thibault@ens-lyon.org> * src/main.c: scanner: allocate correct buffer size for m4 path. Flex did not check the length of the m4 path which could lead to a buffer overflow in some cases. Additionally, not all platforms believe in PATH_MAX, so stop relying on it. Fixes #138 2016-11-24 Will Estes <westes575@gmail.com> * NEWS: doc: note no more libcompat in NEWS 2016-11-24 Will Estes <westes575@gmail.com> * lib/Makefile.am: build: explain empty lib/Makefile.am 2016-11-20 Explorer09 <explorer09@gmail.com> * configure.ac: build: warn about cross compiling with *alloc 2016-11-19 Explorer09 <explorer09@gmail.com> * configure.ac, lib/Makefile.am, lib/lib.c, src/Makefile.am: build: Link $(LIBOBJS) from src/ dir, remove libcompat.la. The libcompat.la library was small and less friendly to bootstrapping and cross compilation. Now, we will simply link individual object files as needed, which is simpler. 2016-11-16 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: Let stage1flex respect LFLAGS 2016-11-14 Will Estes <westes575@gmail.com> * NEWS: doc: describe --disable-libfl in NEWS 2016-10-31 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: Add --disable-libfl configure option. Disabling libfl is useful when building flex for a cross-toolchain. Fixes: GH-99 2016-11-09 Demi Obenour <demiobenour@gmail.com> * src/flex.skl, tests/array_r.l: fix backwards incompatible changes in 2.6.2. This patch addscompatibility `#defines` for all macros affected by `%prefix`. Fixes #113. 2016-11-08 Will Estes <westes575@gmail.com> * tests/.gitignore: git: ignore quote_in_comment artifacts 2016-11-08 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/Makefile.am, tests/quote_in_comment.l, tests/quote_in_comment.txt: Fixes a major bug in Flex's own lexing of literals. My changes caused Flex to mishandle string and character literals in line comments. This commit fixes them. Fixes #113. 2016-11-06 Thomas Klausner <wiz@NetBSD.org> * configure.ac: Fix unportable test(1) operator. "==" is only supported by bash, "=" is the standard comparison operator. 2016-11-02 Demi Obenour <demiobenour@gmail.com> * tests/quotes.l: Add more escaping tests 2016-11-01 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix another escaping bug in non-indented verbatim section 2 code. I also did some reformatting. 2016-10-28 Alastair Hughes <hobbitalastair@gmail.com> * configure.ac: build: fix false negatives for help2man and texi2dvi HELP2MAN and TEXI2DVI (or the corresponding ac_prog variables) will never be zero length as they fall back to the missing script; check for the fall back and warn on that instead of always warning. 2016-10-28 Explorer09 <explorer09@gmail.com> * doc/Makefile.am: doc: Don't delete flex.1 during "make distclean". flex.1 is pre-generated in release tarball. If we delete it, the next "configure and make" on the source directory will then require help2man unnecessarily. 2016-10-27 Alastair Hughes <hobbitalastair@gmail.com> * NEWS, doc/Makefile.am: Only regenerate the man page when required. Make the flex binary an order-only prerequisite, and add back the prerequisites from before 7cfb440. This prevents rebuilding the man page whenever the flex binary is rebuilt, which causes problems if help2man is not installed and will never work when cross compiling. Fixes #108. 2016-10-26 Will Estes <westes575@gmail.com> * NEWS, src/Makefile.am: build: no longer build PIC version of libfl. The PIC version of libfl was not being built correctly. From the lack of bug reports around this problem, we conclude that the PIC version of libfl is not used and so we drop it from the build build targets for flex. 2016-10-25 Explorer09 <explorer09@gmail.com> * README.md: doc: README.md formatting fixes * Wrap everything in the raw document in 72 char per line limit. * Proper casing for terms "Git" and "GitHub" (don't try to look lazy). * Add unordered list marks when needed. * Say `configure && make && make install` and quoted for fixed-width font. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> 2016-10-25 Will Estes <westes575@gmail.com> * NEWS, configure.ac: build: version 2.6.3 begins 2016-10-24 Will Estes <westes575@gmail.com> * NEWS: doc: mark 2.6.2 release date 2016-10-24 Will Estes <westes575@gmail.com> * .gitignore, NEWS, configure.ac: build: switch xz to lzip 2016-10-20 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/quotes.l: Fix M4 quotation in section 2 prologue and refactor duplicated code 2016-10-21 Alex Kennedy <alexzanderkennedy@gmail.com> * doc/flex.texi: Update flex.texi: Removed repedative wording "Flex used to" was written twice at the beginning of Chapter 9, paragraph 2. 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/dfa.c, src/gen.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, tests/bison_yylval_scanner.l, tests/include_by_push.direct.l: Improved M4 quotation This fixes M4 quotation of certain strings beginning with `yy` (in section 3 of the input file only) and character literals. The new quotation method is also less brittle and faster. Tests that relied on the old behavior were fixed. Also, `yyconst` is no longer defined; use `const` (which it unconditionally was defined to) instead. 2016-10-19 Will Estes <westes575@gmail.com> * Makefile.am, configure.ac: build: for automake, flex is foreign 2016-10-19 Will Estes <westes575@gmail.com> * README, README.md: doc: mv README to README.md 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: touch up README 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: README no longer mentions sourceforge 2016-10-06 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS with more post-2.6.1 additions 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/options.c, src/options.h, src/scan.l, src/yylex.c, tests/Makefile.am, tests/alloc_extra.l, tests/array_r.l, tests/basic_r.l, tests/c_cxx_nr.lll, tests/c_cxx_r.lll, tests/debug_r.l, tests/include_by_reentrant.direct.l, tests/lineno_r.l, tests/mem_nr.l, tests/mem_r.l, tests/posix.l, tests/posixly_correct.l, tests/pthread.l, tests/quotes.l, tests/reject.l4, tests/rescan_nr.direct.l, tests/rescan_r.direct.l, tests/string_nr.l, tests/string_r.l: Fix M4 quoting of section 3. This fixes M4 quoting of section 3 of the input file, including escape sequences and character constants. Tests were added to verify the behavior in section 3 with respect to quoting. Both escaping of quotes and quoting of potential macro-start characters are tested. Existing tests were also fixed to account for the new -- and now correct -- behavior. Many tests relied on the old behavior of expanding M4 macros in section 3. They needed to be updated for the new behavior. 2016-10-03 Mightyjo <mightyjo@gmail.com> * src/flex.skl, tests/.gitignore, tests/Makefile.am, tests/cxx_restart.ll, tests/cxx_restart.txt: Fix yyrestart(NULL) SEGV. 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/scan.l: scanner: M4 quoting fixes 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am: Support `make indent` for out of source builds 2016-09-24 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am, src/mkskel.sh: Simplify some shell code 2016-09-23 Demi Obenour <demiobenour@gmail.com> * doc/flex.texi, src/flex.skl, src/flexdef.h, src/main.c, src/options.c, src/options.h, src/scan.l, tests/.gitignore, tests/Makefile.am, tests/noansi_nr.l, tests/noansi_nr.txt, tests/noansi_r.l, tests/noansi_r.txt: no longer generate K&R C scanners 2016-09-04 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix escaping of `[[` and `]]` in strings Previously, `[[` and `]]` were not escaped in strings, which led to bad interactions with m4. Also, don't break strings on newline, as GCC et al support whitespace between a backslash and the subsequent newline. 2016-06-20 Translation Project <coordinator@translationproject.org> * NEWS, po/sv.po: new sv translation 2016-05-23 Demetri Obenour <demiobenour@gmail.com> * src/misc.c: Delete action_m4_define from misc.c This function was not used and always triggered a fatal error when run. 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am, tests/testwrapper-direct.sh: test: run direct tests from srcdir 2016-01-11 Egor Pugin <egor.pugin@gmail.com> * tests/include_by_buffer.direct.l, tests/include_by_push.direct.l, tests/include_by_reentrant.direct.l: Exited with error code on some conditions in include tests 2016-05-20 Will Estes <westes575@gmail.com> * tests/testwrapper.sh: test: drop .exe when making input file names 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am: test: removed dependencies for include tests 2016-04-28 Tobias Klauser <tklauser@distanz.ch> * src/scanflags.c: Avoid realloc on every call of sf_push() Currently, every call to sf_push() realloc()'s _sf_stack, even if the maximum size _sf_max wasn't changed. As the indentation beneath the "if" clause already indicates, the realloc() should only be executed if _sf_max was increased. Found by compiling flex with the -Wmisleading-indentation flags of gcc, which leads to the following warning: scanflags.c: In function ‘sf_push’: scanflags.c:42:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (_sf_top_ix + 1 >= _sf_max) ^~ scanflags.c:44:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ _sf_stk = realloc(_sf_stk, sizeof(scanflags_t) * _sf_max); ^~~~~~~ 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: prettified command to build man page 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: added man page to DISTCLEANFILES 2016-03-31 Will Estes <westes575@gmail.com> * BUGS, TODO: remove unused TODO, BUGS files 2016-03-31 Will Estes <westes575@gmail.com> * to.do/README, to.do/Wilhelms.todo, to.do/Wish-List, to.do/flex.rmail, to.do/streams.mail, to.do/unicode/FlexLexer.h, to.do/unicode/ccl.c, to.do/unicode/changes.txt, to.do/unicode/ecs.c, to.do/unicode/flex.1, to.do/unicode/flex.skl, to.do/unicode/flexdef.h, to.do/unicode/gen.c, to.do/unicode/main.c, to.do/unicode/misc.c, to.do/unicode/scan.l, to.do/unicode/tblcmp.c: removed to.do/ directory 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: removed flex.skl from POTFILES.in file list 2016-03-31 rlar <rlar> * src/Makefile.am: fix skel.c dependency (missing tables_shared.c) and polish build rule Also remove references to srcdir since skel.c is no longer mentioned in po/POTFILES.in. 2016-03-31 rlar <rlar> * doc/Makefile.am: fix flex.1 dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 && \ make dist failed with: > help2man: can't get `--help' info from ../../flex/src/flex Note: There is no dependency except for the flex binary. 2016-03-31 rlar <rlar> * src/Makefile.am: fix stage1scan.c and stage1scan.l dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 failed with: > ../src/stage1flex -o stage1scan.c stage1scan.l > stage1flex: can't open stage1scan.l Note: stage1scan.c is not necessairy in the "make dist" generated tar.gz file. stage1flex will be build from scan.c (which is distributed), and this will then generate stage1scan.c from scan.l 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: list src/flex.skl in po/POTFILES.in 2016-03-29 rlar <rlar> * src/gen.c: warning in generated code, with -Ca warning: conversion to 'yy_state_type' from 'flex_uint32_t' may change the sign of the result [-Wsign-conversion] 2016-03-29 rlar <rlar> * tests/Makefile.am: suppress `WARNINGFLAGS' for the almost obsolete `noansi' test cases 2016-03-29 rlar <rlar> * configure.ac, src/Makefile.am, tests/Makefile.am: configure option `--enable-warnings' and `WARNINGFLAGS' `WARNINGFLAGS' can be passed when invoking `configure' and when invoking `make' if configure switch `--enable-warnings' was given then default to something useful if we have `GCC' `WARNINGFLAGS' is not used when compiling `stage1flex' to avoid unnecessary clutter 2016-03-31 Tobias Klauser <tklauser@distanz.ch> * src/main.c: Fix potential buffer overflow in strncat() When using clang/llvm 3.8 to compile flex, the following warning is emitted: main.c:378:27: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size] strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ main.c:378:27: note: change the argument to be the free space in the destination buffer minus the terminating null byte strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ sizeof(m4_path) - strlen(m4_path) - 1Fix it up by using the solution proposed by the warning message. 2016-03-29 Robert.Larice Robert Larice <Robert.Larice@t-online.de> * src/Makefile.am: build: simplified dependency tracking so parallel make runs succeed 2016-03-20 rlar <rlar> * src/flex.skl, src/gen.c, src/main.c: avoid warning in generated code, with -Cf warning: conversion to 'unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-18 Will Estes <westes575@gmail.com> * NEWS, configure.ac: mention v2.6.2; summarize changes since 2.6.1 2016-03-18 Will Estes <westes575@gmail.com> * doc/flex.texi: doc: corrected example in manual, gh#67 2016-03-16 rlar <rlar> * tests/string_nr.l, tests/string_r.l, tests/yyextra.l: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * tests/mem_nr.l, tests/mem_r.l, tests/pthread.l: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * src/flex.skl: warning: conversion to 'flex_uint32_t' from 'long unsigned int' may alter its value [-Wconversion] struct yytbl_reader, member bread is of type flex_uint32_t 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/bison_nr_main.c, tests/bison_nr_parser.y, tests/bison_yylloc_parser.y: warning: redundant redeclaration of '...' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/bison_nr_parser.y, tests/bison_yylloc_parser.y, tests/bison_yylval_parser.y, tests/pthread.l: warning: no previous prototype for '...' [-Wmissing-prototypes] 2016-03-16 rlar <rlar> * tests/multiple_scanners_r_main.c: warning: unused variable 'fp' [-Wunused-variable] 2016-03-16 rlar <rlar> * tests/pthread.l: main(), warning: redundant redeclaration of 'main' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/include_by_reentrant.direct.l, tests/lineno_nr.l, tests/lineno_r.l, tests/lineno_trailing.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/array_nr.l, tests/array_r.l, tests/basic_nr.l, tests/basic_r.l, tests/ccl.l, tests/debug_nr.l, tests/debug_r.l, tests/extended.l, tests/mem_nr.l, tests/mem_r.l, tests/noansi_r.l, tests/posix.l, tests/posixly_correct.l, tests/prefix_nr.l, tests/prefix_r.l, tests/quotes.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-01 rlar <rlar> * src/ecs.c, src/tblcmp.c: Fix two more casts 2016-03-14 Bastian Köcher <git@kchr.de> * src/gen.c: Fixes yyl compare with unsigned warning 2016-03-13 Robert Larice <Robert.Larice@t-online.de> * configure.ac: Suppress portability warnings in Makefile generation 2016-02-27 rlar <rlar> * src/flex.skl: generated code, in yyensure_buffer_stack(), change type of local `num_to_alloc' which is exclusively used in yy_size_t context 2016-03-01 rlar <rlar> * src/flex.skl: generated code, in yy_get_next_buffer(), change type of local `number_to_move' suits better, because `yy_n_chars' and `yy_buf_size' are of type `int' 2016-02-27 rlar <rlar> * src/flex.skl: generated code, `_yybytes_len' is of type `int', fix code accordingly 2016-02-28 rlar <rlar> * src/gen.c: generated code, `max_size' seems to be of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, here `new_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `yy_buf_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `offset' is of type `int' 2016-02-28 rlar <rlar> * src/gen.c: generated code, `yy_more_len' is of type `int' 2016-02-28 rlar <rlar> * src/scan.l: scan.l, rewrite two loops to avoid unneccesairy casting 2016-03-01 rlar <rlar> * src/regex.c, src/tables.c: improve readability 2016-02-28 rlar <rlar> * src/tblcmp.c: another cast in tblcmp.c to avoid warning 2016-02-28 rlar <rlar> * src/buf.c: casts in buf_append() to get rid of warnings 2016-02-28 rlar <rlar> * src/dfa.c, src/gen.c: cast to suite type of flex_uint32_t td_lolen 2016-02-28 rlar <rlar> * src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanopt.c, src/tables_shared.c: cast to get rid of warnings 2016-03-01 rlar <rlar> * src/buf.c, src/main.c: cast and fix usage of log10(), ceil to prevent buffer overflow 2016-03-01 rlar <rlar> * src/tables.c: tables.c, sprinkle casts to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_data_compress(), change type of local newsz to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c, src/tables.h: change type of struct yytbl_writer.total_written to get rid of warnings 2016-02-28 rlar <rlar> * src/tables.c: change argument type of yytbl_writen() to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_write8/16/32(), change type of local variables to get rid of warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/misc.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: change return type and rename int htoi()/otoi() --> unsigned int htoui()/otoui() 2016-03-01 Will Estes <westes575@gmail.com> * NEWS: Mention 2.6.1 release date 2016-02-28 rlar <rlar> * src/gen.c: avoid warning, add (int) cast to the read() return value For similiarity with the fread() case. 2016-02-28 rlar <rlar> * src/scan.l: avoid warning, POSIX says yyless() has an `int' argument 2016-02-29 rlar <rlar> * src/filter.c: use type size_t in filter_tee_header() to avoid warnings 2016-02-29 rlar <rlar> * src/filter.c, src/misc.c, src/scanopt.c, src/tables.c: add (size_t) casts to malloc invocations to prevent warnings 2016-02-29 rlar <rlar> * src/buf.c, src/misc.c, src/scan.l, src/scanopt.c, src/tables.c: add (int) casts to some strlen() invocations to prevent warnings 2016-02-29 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndlookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndinstal(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: cclinstal() and ccllookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/gen.c: warning: redundant redeclaration of ‘gen_next_state’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/gen.c: warning: no previous prototype for ‘mkecstbl’ [-Wmissing-prototypes] 2016-02-28 rlar <rlar> * src/main.c: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yywrap’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yylval’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yyin’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h, src/main.c: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: unification, rename some more rename these too for improved similiarity: OPTION_OP OPT_HEADER OPT_EXTRA_TYPE OPT_TABLES 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: fix name clash, OPT_OUTFILE from parse.y and from options.h these collide: OPT_OUTFILE OPT_PREFIX OPT_YYCLASS rename them TOK_... in the parser 2016-02-28 Will Estes <westes575@gmail.com> * lib/reallocarray.c: Prototyped reallocarray implementation 2016-02-28 Will Estes <westes575@gmail.com> * src/scanopt.c: Removed custom strcasecmp() function 2016-02-28 rlar <rlar> * src/flex.skl: fwrite wants a size_t, yyleng is int per posix 2016-02-28 rlar <rlar> * src/scanopt.c: Remove some unneeded casts 2016-02-28 rlar <rlar> * src/flexdef.h: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion] 2016-02-27 rlar <rlar> * src/dfa.c, src/parse.y: dfa.c:157:24: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] most certainly safe cast 2016-02-27 rlar <rlar> * src/ccl.c: ccl.c:86:19: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion] ch seems to have been checked for proper range some lines above 2016-02-27 rlar <rlar> * tests/bison_nr_parser.y: warning: deprecated directive, use '%pure-parser' [-Wdeprecated] 2016-02-27 rlar <rlar> * lib/lib.c: warning: no previous prototype for 'do_nothing' [-Wmissing-prototypes] 2016-02-27 rlar <rlar> * src/libmain.c: included stdlib.h header 2016-02-27 Will Estes <westes575@gmail.com> * NEWS: Described more post v2.6.0 changes 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: build: Removed bzip2 distribiution archive 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: removed obsolete program check 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: Made some program checks more robust 2016-02-27 rlar <rlar> * src/flex.skl: Remove unneeded cast to int 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fixed incorrect integer type 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fix more integer types, resolves sf 184, 187 2016-02-26 Robert Larice <Robert.Larice@t-online.de> * src/flex.skl, src/gen.c: Removed some type conversion warnings 2016-02-26 Will Estes <westes575@gmail.com> * src/flex.skl: Changed another buffer size to int; resolves gh#61 2016-02-24 Will Estes <westes575@gmail.com> * src/flex.skl: Changed type of yy_n_chars to int; gh#53, sf#160. The variable yy_n_chars had been of type yy_size_t which is incorrect given its use in read(). While it might be adviseable to look at defining a yy_ssize_t, there might be some issues doing this and so, for now, at least, we'll punt back to int. 2016-02-24 Will Estes <westes575@gmail.com> * src/buf.c: Fixed size of bufferallocation, resolved gh#54. The value of n_alloc was a count, not a size. Multiplying the value by the element size was incorrect. That multiplication was already being done and having it done twice was incorrect. 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/scan.l: Allow '%option noline' in flex input file, resolves gh#56. Allow specifying '%option noline' in the input file, leading to the same effect as calling flex with the command line option --noline. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/buf.c, src/main.c: Emit no #line directives if gen_line_dirs is false, resolves igh#55. There are two instances in the code which will print a #line directive to the resulting lexer, regardless of the value of gen_line_dirs. Fix them, so they also respect gen_line_dirs. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-16 Tobias Klauser <tklauser@distanz.ch> * lib/lib.c, src/gen.c, src/misc.c, src/scan.l: Converted K&R style function definitions to ANSI C style Consistently make use of the ANSI C function definition style instead of the K&R style. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Used NULL constant instead of plain integer for NULL pointer. The sparse static checker warns about using plain integer 0 as NULL pointers in the generated lexer code. Fix this by using NULL consistently for pointers. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Marked declaration and definition of yy_fatal_error as noreturn. Only the declaration of yy_fatal_error is marked with __attribute__((__noreturn__)) in case GCC >= 3 is used, but not the definition. This leads to the sparse static checker to complain about function declaration mismatch. Fix it by defining a macro yynoreturn and using it for both the declaration and the definition of yy_fatal_error. 2016-01-27 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Fixed declaration mismatch in yy_fatal_error. The prototype declares yy_fatal_error parameter as "const char msg[]" while the definition uses "const char* msg" (introduced by commit e9d5fc713f61b) which causes the sparse static checkers to produce an error. Fix this by adjusting the definition to use "const char* msg" as well. Also change the C++ version accordingly so it matches the declaration in FlexLexer.hpp. 2016-01-23 Will Estes <westes575@gmail.com> * CODE_OF_CONDUCT.md: flex is for flex #NCoC 2016-01-18 Will Estes <westes575@gmail.com> * doc/flex.texi: Referred to github for issue tracking, no longer sf 2016-01-10 Egor Pugin <egor.pugin@gmail.com> * tests/reject.l4, tests/tableopts.l4: Opened files in binary mode explicitly 2016-01-08 OBATA Akio <obache@NetBSD.org> * src/Makefile.am: Linked flex binary against libintl, not libfl. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> 2016-01-08 Michael van Elst <mlelstv@NetBSD.org> * src/filter.c: Improved pipe-stdin hack behavior; resolves sf#198. Signed-off-by: Thomas <Klausner wiz@NetBSD.org> 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac, src/flexdef.h: Removed no longer needed header checks 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac: Checked for reallocarray() with AC_REPLACE_FUNCS 2015-12-27 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: include libgen.h from flexdef.h, not main.c 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Replace basename2() with basename(3). Given the following program: \#include <libgen.h> \#include <stdio.h> /* extracts basename from path, optionally stripping the extension "\.*" * (same concept as /bin/sh `basename`, but different handling of extension). */ static char *basename2 (char *path) { char *b; for (b = path; *path; path++) if (*path == '/') b = path + 1; return b; } static void basename_compare(char *path) { printf("basename: %s\n", basename(path)); printf("basename2: %s\n\n", basename2(path)); } int main (int argc, char *argv[]) { // From http://pubs.opengroup.org/onlinepubs/9699919799/ // ``Sample Input and Output Strings'' basename_compare("/usr/lib"); basename_compare("/usr/"); basename_compare("/"); basename_compare("///"); basename_compare("//usr//lib//"); return 0; } ... and the program's output: basename: lib basename2: lib basename: usr basename2: basename: / basename2: basename: / basename2: basename: lib basename2: ... we can see that basename2() behaves the same as basename(3) in the average use case, but messes up pretty severely in others. Besides that, basename(3) is mandated by POSIX so should be present on modern Unix-like systems, so we shouldn't define it ourselves. Some notes: - it doesn't appear to be mentioned in POSIX, but OpenBSD's basename(3) returns NULL if the returned path componenet is > PATH_MAX, so add a check for that - basename(3) shouldn't return an empty string, so remove the program_name[0] != '\0' check 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Simplify basename2(). It's only call site does not activate the `strip_ext` code path, so the function can be simplified a lot. While here, remove a double assignment. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flex.skl, src/misc.c: Cleaned up __STDC__ #ifdefs. Assuming a compiler conforming to the ISO C standard is used, i.e., __STDC__ is defined to 1, YY_USE_CONST is always defined and can be eliminated. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flexdef.h, src/main.c, src/scanopt.c, src/scanopt.h, src/sym.c: Remove remaining use of PROTO 2015-12-21 Serguey Parkhomovsky <xindigo@gmail.com> * src/buf.c: buf.c: use snprintf 2015-12-19 Will Estes <westes575@gmail.com> * configure.ac: build: reformatted AC_CHECK_FUNCS for readability 2015-12-17 Will Estes <westes575@gmail.com> * src/scanopt.c: correct function prototype 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c, src/scanopt.c, src/sym.c, src/tblcmp.c: Remove more instances of PROTO 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c: Removed prototype for main(). It's not called anywhere else so the prototype is not needed. See the C99 standard [1], section 5.1.2.2.1 for more info. [1]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/dfa.c, src/gen.c, src/nfa.c, to.do/unicode/main.c, to.do/unicode/tblcmp.c: Removed more instances of PROTO, ansifying. 2015-12-13 Will Estes <westes575@gmail.com> * README: Noted github for issue tracking and pull requests 2015-12-13 Michael McConville <mmcco@mykolab.com> * README: Reformatted README; removed sf bug tracking link. 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/gen.c, to.do/unicode/gen.c: Removed macros for indentation level. Just increment or decrement the indentation counter. That's less to remember and makes the code more readable. w# Please enter the commit message for your changes. Lines starting 2015-12-12 Mike Frysinger <vapier@gentoo.org> * tests/Makefile.am, tests/testwrapper.sh: tests: fixed paths to input files. The current test wrapper works only when the inputs are specified using relative paths. If they're specified with absolute paths, the driver fails to detect the inputs because it always prepends the input dir name which itself is a relative path: $ cd tests $ ./testwrapper.sh -d . -i $PWD/reject.txt -t ./reject_ver.table <fails to open inputs> This normally doesn't show up because people run `./configure` or, for out of tree builds, `../configure`. But if you happen to run configure with an absolute path, then automake tends to generate absolute paths as well leading to test failures. Fix all of this by dropping the implicit input directory prepending. - INPUT_NAME is often a list of files, not just a single one - the input directory is used to find the testname tables which are usually generated, so it's impossible to use files from both source and build directories - most of the time, the full/correct path is already specified 2015-12-12 Mike Frysinger <vapier@gentoo.org> * configure.ac: configure: fixed realloc test. The [] characters are used for quoting in m4, so the attempt to use them in place of `test` fails yielding the warning at build time: .../flex/configure: line 20222: no: command not found 2015-12-12 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Started removal of PROTO macro. The PROTO macro is no longer needed. Additionally, its usage is inconsistent, so we began removing it. 2015-12-12 Michael Reed <m.reed@mykolab.com> * Makefile.am, src/main.c: Removed SHORT_FILE_NAMES preprocessor symbol. As a relic of MS-DOS, we don't need this. It's never defined; see 13b5b214f53d1c3354a7ab910bd160c126df1331. Removed additional MSDOS ifdef. 2015-12-11 Michael McConville <mmcco@mykolab.com> * configure.ac, lib/reallocarray.c, src/flexdef.h: Added new function reallocarray. This is taken from OpenSSH Portable, which in turn takes it from OpenBSD. reallocarray wraps the stdlib's realloc function. It takes two size arguments and checks for overflow, like calloc, but doesn't zero the memory. Therefore, it allows us to do overflow-safe array reallocations and overflow-safe unzeroed array allocations, which the stdlib allocation functions don't. We have a bunch of specific array allocation macros, none of which check for overflow. reallocarray should be able to replace them. 2015-12-11 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Removed MS-DOS, VMS macros. Given the age of the MS-DOS and VMS platforms, it's likely that no one is building flex on them any more. Additionally, the preferred approach is to test for particular platform features rather than to test for particular platforms. 2015-12-12 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: Made search for m4 more explicit. 2015-12-12 Will Estes <westes575@gmail.com> * src/flex.skl: Returned 0 from yywrap() instead of EOF 2015-12-11 Will Estes <westes575@gmail.com> * src/libmain.c: Changed end of main() in libmain to exit(0) 2015-12-11 Will Estes <westes575@gmail.com> * NEWS, configure.ac: Mentioned v2.6.1; documented some changes since v2.6.0 2015-12-11 Will Estes <westes575@gmail.com> * README: Updated build documentation; finished sf#155. Removed version numbers for build tools. Noted that version requirements for build tools will be noted in configure.ac. Expanded documentation of building texinfo based docs. 2015-12-11 Will Estes <westes575@gmail.com> * doc/Makefile.am: Removed flex.pdf from distribution; partially fixed sf#155 2015-12-11 Will Estes <westes575@gmail.com> * src/flex.skl: Commented in C style in skeleton; fixed sf#195 2015-12-10 Will Estes <westes575@gmail.com> * .gitignore: Ignored autoscan files 2015-12-09 Will Estes <westes575@gmail.com> * configure.ac: Checked for ranlib and strdup() at configure time 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/tblcmp.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/tblcmp.c: Replace zero_out() with stdlib's memset. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flex.skl: Removed memory allocation casts. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed alloca() configuration. Since alloca() is dangerous, depricated, we remove it. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed implementation of isascii(). POSIX defines isascii(), so it's likely present on anything weactually build flex on these days. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/main.c, src/scanopt.c, src/tables.c: Removed NULL-checks before free() 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/flexdef.h, src/gen.c, src/scan.l, to.do/unicode/flexdef.h, to.do/unicode/scan.l: Removed flex_free()i, corrected buf_destroy logic. As with flex_alloc(), replace with direct calls to free(). The function buf_destroy is now null safe and the logic was corrected to free() correctly. 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/filter.c, src/flexdef.h, src/misc.c, src/scan.l, src/scanflags.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_realloc(). As with flex_alloc(), replace calls to flex_realloc(), which was just a wrapper around realloc(). 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanflags.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_alloc; cleaned up style. The function flex_alloc() was just a wrapper around malloc(). Since this only added unclarity, and the flex_alloc() function is likely a legacy of olden times, remove it in favor of calls to malloc() directly. Style elements cleaned up: * superfluous spacing around parentheses * non-constant initialization in variable declarations * needless casts * almost all uses of assignments as subexpressions 2015-12-07 Michael McConville <mmcconville@mykolab.com> * src/dfa.c, src/flexdef.h, src/gen.c, src/main.c, src/scan.l, src/scanopt.c, tests/bison_nr_scanner.l, tests/bison_yylloc_scanner.l, tests/bison_yylval_scanner.l, tests/mem_nr.l, tests/mem_r.l, tests/pthread.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l, to.do/unicode/scan.l: Remove allocation casts 2015-12-07 Will Estes <westes575@gmail.com> * src/.gitignore, src/Makefile.am: Built flex with itself. Changes in scan.l need to be built into flex with the same version of flex in some cases. Since this build requirement is minimal, we simply bootstrap flex unconditionally. We intentionally exclude from version control the bootstrap artifacts as the extra copy of the lexer, the intermediate scanner and the bootstrap executable are not of interest. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, to.do/unicode/main.c, to.do/unicode/scan.l: Use NULL rather than (type *) 0. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: Replace copy_unsigned_string() with xstrdup(). Like copy_string(), copy_unsigned_string() is just a clone of the stlib's strdup(). We only use it twice. I'm pretty confident that char signedness is irrelevant in this case. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Cleaned up white space. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Removed struct keyword before yy_buffer_state 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * examples/testxxLexer.l, src/FlexLexer.h, src/flex.skl, src/main.c: Replaced FLEX_STD macro with std::. The std:: construct exists as of C++98, so we can simply assume it is supported. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/Makefile.am: Generated skel.c explicitly in srcdir. Rewrote the target for skel.c to explicitly mention the srcdir. This should help when building flex from a directory outside the flex tree. Spread the rule out over several lines to enhance readability. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * autogen.sh: Called glibtoolize if libtoolize run fails. On Mac OS X, libtoolize is known as glibtoolize. In cases where libtoolize is not present, then calling glibtoolize when bootstrapping the build system gives more folks a shot at getting flex built from the ground up. 2015-12-02 Mightyjo <mightyjo@gmail.com> * configure.ac: Checked for (g)texi2dvi. Better bison, help2man checks. Added test for presence of (g)texi2dvi program. Gave notice if texi2dvi is unavailable and set TEXI2DVI=: to avoid giving users headaches. Enhanced tests for bison and help2man with notices when the programs aren't found. Set their program variables to use the missing script in build-aux since it's compatible with them. 2015-12-02 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/parse.y, src/scan.l, src/sym.c, src/tables.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Made string copying more standard. copy_string() was a clone of the stdlib's strdup(). For safety, simplicity, and speed, we should use that instead. We introduce xstrdup() which wraps strdup() in a failure upon memory allocation errors. 2015-11-30 Serguey Parkhomovsky <sergueyparkhomovsky@gmail.com> * src/scan.l: Error on unbalanced parentheses in rules section. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Cleaned up BUILT_SOURCES list. Removed reference to skel.c as a built source since other make rules cover this case. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Sorted file names in flex_SOURCES 2015-11-27 Mightyjo <mightyjo@gmail.com> * src/ecs.c, src/flexdef.h, src/main.c, src/misc.c, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Replaced CHAR macro with unsigned char type. Thanks to Michael McConville for pointing out that the old Char macro causes problems with static analysis. The macro has been removed and replaced with 'unsigned char' throughout the flex sources. The macro is not needed at best and was confusing at worst. It was not used in any of the example files nor was it mentioned in the manual at all. 2015-11-21 Will Estes <westes575@gmail.com> * configure.ac: updated syntax of AC_INIT call as per autoupdate 2015-11-21 Will Estes <westes575@gmail.com> * tests/Makefile.am: removed extra call to a _CPPFLAGS variable 2015-05-14 Stefan Reinauer <stefan.reinauer@coreboot.org> * src/buf.c, src/ccl.c, src/dfa.c, src/ecs.c, src/gen.c, src/main.c, src/misc.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Switch function definitions from mixed K&R to consistent ANSI C. flex was using K&R function definitions for some functions and ANSI C style in others, sometimes even in the same file. Change the code to consistently use ANSI C. Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> 2015-11-16 Mightyjo <mightyjo@gmail.com> * tests/Makefile.am: Used in-tree header file for c++ tests.
2017-01-02 19:26:30 +03:00
printf("Testing: test_scan_string(%s): ",INPUT_STRING_1); fflush(stdout);
testlex_init(&scanner);
state = test_scan_string ( INPUT_STRING_1 ,scanner);
testlex(scanner);
test_delete_buffer(state, scanner);
testlex_destroy(scanner);
2016-01-09 18:43:18 +03:00
/* Scan only the first 12 chars of a string. */
2016-12-30 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS for 2.6.3 release 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: New configure option '--disable-bootstrap'. If configure is run with '--disable-bootstrap', then stage1flex won't be built and stage1scan.c will be generated by sed'ing scan.c. This option is intended to workaround bootstrap bugs rather than to fix the bootstrapping issues which are proving subtler and harder to fix than anyone would like. 2016-11-26 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: "make clean" deletes stage1scan.c, stage1flex 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: allow building libfl even with --disable-libfl. For various reasons, we may wish to build libfl explicitly even when configure has been run with the --disable-libfl option. This is possible, now, via 'make -C src libfl.la'. 2016-12-19 Alexis La Goutte <alexis.lagoutte@gmail.com> * src/flex.skl: scanner: remove trailing whitespace in skeleton 2016-12-01 Demi Obenour <demiobenour@gmail.com> * src/buf.c, src/main.c, src/parse.y: scanner: Disallow, overquote '[' and ']' in prefix 2016-12-29 Samuel Thibault <samuel.thibault@ens-lyon.org> * src/main.c: scanner: allocate correct buffer size for m4 path. Flex did not check the length of the m4 path which could lead to a buffer overflow in some cases. Additionally, not all platforms believe in PATH_MAX, so stop relying on it. Fixes #138 2016-11-24 Will Estes <westes575@gmail.com> * NEWS: doc: note no more libcompat in NEWS 2016-11-24 Will Estes <westes575@gmail.com> * lib/Makefile.am: build: explain empty lib/Makefile.am 2016-11-20 Explorer09 <explorer09@gmail.com> * configure.ac: build: warn about cross compiling with *alloc 2016-11-19 Explorer09 <explorer09@gmail.com> * configure.ac, lib/Makefile.am, lib/lib.c, src/Makefile.am: build: Link $(LIBOBJS) from src/ dir, remove libcompat.la. The libcompat.la library was small and less friendly to bootstrapping and cross compilation. Now, we will simply link individual object files as needed, which is simpler. 2016-11-16 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: Let stage1flex respect LFLAGS 2016-11-14 Will Estes <westes575@gmail.com> * NEWS: doc: describe --disable-libfl in NEWS 2016-10-31 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: Add --disable-libfl configure option. Disabling libfl is useful when building flex for a cross-toolchain. Fixes: GH-99 2016-11-09 Demi Obenour <demiobenour@gmail.com> * src/flex.skl, tests/array_r.l: fix backwards incompatible changes in 2.6.2. This patch addscompatibility `#defines` for all macros affected by `%prefix`. Fixes #113. 2016-11-08 Will Estes <westes575@gmail.com> * tests/.gitignore: git: ignore quote_in_comment artifacts 2016-11-08 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/Makefile.am, tests/quote_in_comment.l, tests/quote_in_comment.txt: Fixes a major bug in Flex's own lexing of literals. My changes caused Flex to mishandle string and character literals in line comments. This commit fixes them. Fixes #113. 2016-11-06 Thomas Klausner <wiz@NetBSD.org> * configure.ac: Fix unportable test(1) operator. "==" is only supported by bash, "=" is the standard comparison operator. 2016-11-02 Demi Obenour <demiobenour@gmail.com> * tests/quotes.l: Add more escaping tests 2016-11-01 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix another escaping bug in non-indented verbatim section 2 code. I also did some reformatting. 2016-10-28 Alastair Hughes <hobbitalastair@gmail.com> * configure.ac: build: fix false negatives for help2man and texi2dvi HELP2MAN and TEXI2DVI (or the corresponding ac_prog variables) will never be zero length as they fall back to the missing script; check for the fall back and warn on that instead of always warning. 2016-10-28 Explorer09 <explorer09@gmail.com> * doc/Makefile.am: doc: Don't delete flex.1 during "make distclean". flex.1 is pre-generated in release tarball. If we delete it, the next "configure and make" on the source directory will then require help2man unnecessarily. 2016-10-27 Alastair Hughes <hobbitalastair@gmail.com> * NEWS, doc/Makefile.am: Only regenerate the man page when required. Make the flex binary an order-only prerequisite, and add back the prerequisites from before 7cfb440. This prevents rebuilding the man page whenever the flex binary is rebuilt, which causes problems if help2man is not installed and will never work when cross compiling. Fixes #108. 2016-10-26 Will Estes <westes575@gmail.com> * NEWS, src/Makefile.am: build: no longer build PIC version of libfl. The PIC version of libfl was not being built correctly. From the lack of bug reports around this problem, we conclude that the PIC version of libfl is not used and so we drop it from the build build targets for flex. 2016-10-25 Explorer09 <explorer09@gmail.com> * README.md: doc: README.md formatting fixes * Wrap everything in the raw document in 72 char per line limit. * Proper casing for terms "Git" and "GitHub" (don't try to look lazy). * Add unordered list marks when needed. * Say `configure && make && make install` and quoted for fixed-width font. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> 2016-10-25 Will Estes <westes575@gmail.com> * NEWS, configure.ac: build: version 2.6.3 begins 2016-10-24 Will Estes <westes575@gmail.com> * NEWS: doc: mark 2.6.2 release date 2016-10-24 Will Estes <westes575@gmail.com> * .gitignore, NEWS, configure.ac: build: switch xz to lzip 2016-10-20 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/quotes.l: Fix M4 quotation in section 2 prologue and refactor duplicated code 2016-10-21 Alex Kennedy <alexzanderkennedy@gmail.com> * doc/flex.texi: Update flex.texi: Removed repedative wording "Flex used to" was written twice at the beginning of Chapter 9, paragraph 2. 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/dfa.c, src/gen.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, tests/bison_yylval_scanner.l, tests/include_by_push.direct.l: Improved M4 quotation This fixes M4 quotation of certain strings beginning with `yy` (in section 3 of the input file only) and character literals. The new quotation method is also less brittle and faster. Tests that relied on the old behavior were fixed. Also, `yyconst` is no longer defined; use `const` (which it unconditionally was defined to) instead. 2016-10-19 Will Estes <westes575@gmail.com> * Makefile.am, configure.ac: build: for automake, flex is foreign 2016-10-19 Will Estes <westes575@gmail.com> * README, README.md: doc: mv README to README.md 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: touch up README 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: README no longer mentions sourceforge 2016-10-06 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS with more post-2.6.1 additions 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/options.c, src/options.h, src/scan.l, src/yylex.c, tests/Makefile.am, tests/alloc_extra.l, tests/array_r.l, tests/basic_r.l, tests/c_cxx_nr.lll, tests/c_cxx_r.lll, tests/debug_r.l, tests/include_by_reentrant.direct.l, tests/lineno_r.l, tests/mem_nr.l, tests/mem_r.l, tests/posix.l, tests/posixly_correct.l, tests/pthread.l, tests/quotes.l, tests/reject.l4, tests/rescan_nr.direct.l, tests/rescan_r.direct.l, tests/string_nr.l, tests/string_r.l: Fix M4 quoting of section 3. This fixes M4 quoting of section 3 of the input file, including escape sequences and character constants. Tests were added to verify the behavior in section 3 with respect to quoting. Both escaping of quotes and quoting of potential macro-start characters are tested. Existing tests were also fixed to account for the new -- and now correct -- behavior. Many tests relied on the old behavior of expanding M4 macros in section 3. They needed to be updated for the new behavior. 2016-10-03 Mightyjo <mightyjo@gmail.com> * src/flex.skl, tests/.gitignore, tests/Makefile.am, tests/cxx_restart.ll, tests/cxx_restart.txt: Fix yyrestart(NULL) SEGV. 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/scan.l: scanner: M4 quoting fixes 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am: Support `make indent` for out of source builds 2016-09-24 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am, src/mkskel.sh: Simplify some shell code 2016-09-23 Demi Obenour <demiobenour@gmail.com> * doc/flex.texi, src/flex.skl, src/flexdef.h, src/main.c, src/options.c, src/options.h, src/scan.l, tests/.gitignore, tests/Makefile.am, tests/noansi_nr.l, tests/noansi_nr.txt, tests/noansi_r.l, tests/noansi_r.txt: no longer generate K&R C scanners 2016-09-04 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix escaping of `[[` and `]]` in strings Previously, `[[` and `]]` were not escaped in strings, which led to bad interactions with m4. Also, don't break strings on newline, as GCC et al support whitespace between a backslash and the subsequent newline. 2016-06-20 Translation Project <coordinator@translationproject.org> * NEWS, po/sv.po: new sv translation 2016-05-23 Demetri Obenour <demiobenour@gmail.com> * src/misc.c: Delete action_m4_define from misc.c This function was not used and always triggered a fatal error when run. 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am, tests/testwrapper-direct.sh: test: run direct tests from srcdir 2016-01-11 Egor Pugin <egor.pugin@gmail.com> * tests/include_by_buffer.direct.l, tests/include_by_push.direct.l, tests/include_by_reentrant.direct.l: Exited with error code on some conditions in include tests 2016-05-20 Will Estes <westes575@gmail.com> * tests/testwrapper.sh: test: drop .exe when making input file names 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am: test: removed dependencies for include tests 2016-04-28 Tobias Klauser <tklauser@distanz.ch> * src/scanflags.c: Avoid realloc on every call of sf_push() Currently, every call to sf_push() realloc()'s _sf_stack, even if the maximum size _sf_max wasn't changed. As the indentation beneath the "if" clause already indicates, the realloc() should only be executed if _sf_max was increased. Found by compiling flex with the -Wmisleading-indentation flags of gcc, which leads to the following warning: scanflags.c: In function ‘sf_push’: scanflags.c:42:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (_sf_top_ix + 1 >= _sf_max) ^~ scanflags.c:44:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ _sf_stk = realloc(_sf_stk, sizeof(scanflags_t) * _sf_max); ^~~~~~~ 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: prettified command to build man page 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: added man page to DISTCLEANFILES 2016-03-31 Will Estes <westes575@gmail.com> * BUGS, TODO: remove unused TODO, BUGS files 2016-03-31 Will Estes <westes575@gmail.com> * to.do/README, to.do/Wilhelms.todo, to.do/Wish-List, to.do/flex.rmail, to.do/streams.mail, to.do/unicode/FlexLexer.h, to.do/unicode/ccl.c, to.do/unicode/changes.txt, to.do/unicode/ecs.c, to.do/unicode/flex.1, to.do/unicode/flex.skl, to.do/unicode/flexdef.h, to.do/unicode/gen.c, to.do/unicode/main.c, to.do/unicode/misc.c, to.do/unicode/scan.l, to.do/unicode/tblcmp.c: removed to.do/ directory 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: removed flex.skl from POTFILES.in file list 2016-03-31 rlar <rlar> * src/Makefile.am: fix skel.c dependency (missing tables_shared.c) and polish build rule Also remove references to srcdir since skel.c is no longer mentioned in po/POTFILES.in. 2016-03-31 rlar <rlar> * doc/Makefile.am: fix flex.1 dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 && \ make dist failed with: > help2man: can't get `--help' info from ../../flex/src/flex Note: There is no dependency except for the flex binary. 2016-03-31 rlar <rlar> * src/Makefile.am: fix stage1scan.c and stage1scan.l dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 failed with: > ../src/stage1flex -o stage1scan.c stage1scan.l > stage1flex: can't open stage1scan.l Note: stage1scan.c is not necessairy in the "make dist" generated tar.gz file. stage1flex will be build from scan.c (which is distributed), and this will then generate stage1scan.c from scan.l 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: list src/flex.skl in po/POTFILES.in 2016-03-29 rlar <rlar> * src/gen.c: warning in generated code, with -Ca warning: conversion to 'yy_state_type' from 'flex_uint32_t' may change the sign of the result [-Wsign-conversion] 2016-03-29 rlar <rlar> * tests/Makefile.am: suppress `WARNINGFLAGS' for the almost obsolete `noansi' test cases 2016-03-29 rlar <rlar> * configure.ac, src/Makefile.am, tests/Makefile.am: configure option `--enable-warnings' and `WARNINGFLAGS' `WARNINGFLAGS' can be passed when invoking `configure' and when invoking `make' if configure switch `--enable-warnings' was given then default to something useful if we have `GCC' `WARNINGFLAGS' is not used when compiling `stage1flex' to avoid unnecessary clutter 2016-03-31 Tobias Klauser <tklauser@distanz.ch> * src/main.c: Fix potential buffer overflow in strncat() When using clang/llvm 3.8 to compile flex, the following warning is emitted: main.c:378:27: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size] strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ main.c:378:27: note: change the argument to be the free space in the destination buffer minus the terminating null byte strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ sizeof(m4_path) - strlen(m4_path) - 1Fix it up by using the solution proposed by the warning message. 2016-03-29 Robert.Larice Robert Larice <Robert.Larice@t-online.de> * src/Makefile.am: build: simplified dependency tracking so parallel make runs succeed 2016-03-20 rlar <rlar> * src/flex.skl, src/gen.c, src/main.c: avoid warning in generated code, with -Cf warning: conversion to 'unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-18 Will Estes <westes575@gmail.com> * NEWS, configure.ac: mention v2.6.2; summarize changes since 2.6.1 2016-03-18 Will Estes <westes575@gmail.com> * doc/flex.texi: doc: corrected example in manual, gh#67 2016-03-16 rlar <rlar> * tests/string_nr.l, tests/string_r.l, tests/yyextra.l: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * tests/mem_nr.l, tests/mem_r.l, tests/pthread.l: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * src/flex.skl: warning: conversion to 'flex_uint32_t' from 'long unsigned int' may alter its value [-Wconversion] struct yytbl_reader, member bread is of type flex_uint32_t 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/bison_nr_main.c, tests/bison_nr_parser.y, tests/bison_yylloc_parser.y: warning: redundant redeclaration of '...' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/bison_nr_parser.y, tests/bison_yylloc_parser.y, tests/bison_yylval_parser.y, tests/pthread.l: warning: no previous prototype for '...' [-Wmissing-prototypes] 2016-03-16 rlar <rlar> * tests/multiple_scanners_r_main.c: warning: unused variable 'fp' [-Wunused-variable] 2016-03-16 rlar <rlar> * tests/pthread.l: main(), warning: redundant redeclaration of 'main' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/include_by_reentrant.direct.l, tests/lineno_nr.l, tests/lineno_r.l, tests/lineno_trailing.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/array_nr.l, tests/array_r.l, tests/basic_nr.l, tests/basic_r.l, tests/ccl.l, tests/debug_nr.l, tests/debug_r.l, tests/extended.l, tests/mem_nr.l, tests/mem_r.l, tests/noansi_r.l, tests/posix.l, tests/posixly_correct.l, tests/prefix_nr.l, tests/prefix_r.l, tests/quotes.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-01 rlar <rlar> * src/ecs.c, src/tblcmp.c: Fix two more casts 2016-03-14 Bastian Köcher <git@kchr.de> * src/gen.c: Fixes yyl compare with unsigned warning 2016-03-13 Robert Larice <Robert.Larice@t-online.de> * configure.ac: Suppress portability warnings in Makefile generation 2016-02-27 rlar <rlar> * src/flex.skl: generated code, in yyensure_buffer_stack(), change type of local `num_to_alloc' which is exclusively used in yy_size_t context 2016-03-01 rlar <rlar> * src/flex.skl: generated code, in yy_get_next_buffer(), change type of local `number_to_move' suits better, because `yy_n_chars' and `yy_buf_size' are of type `int' 2016-02-27 rlar <rlar> * src/flex.skl: generated code, `_yybytes_len' is of type `int', fix code accordingly 2016-02-28 rlar <rlar> * src/gen.c: generated code, `max_size' seems to be of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, here `new_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `yy_buf_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `offset' is of type `int' 2016-02-28 rlar <rlar> * src/gen.c: generated code, `yy_more_len' is of type `int' 2016-02-28 rlar <rlar> * src/scan.l: scan.l, rewrite two loops to avoid unneccesairy casting 2016-03-01 rlar <rlar> * src/regex.c, src/tables.c: improve readability 2016-02-28 rlar <rlar> * src/tblcmp.c: another cast in tblcmp.c to avoid warning 2016-02-28 rlar <rlar> * src/buf.c: casts in buf_append() to get rid of warnings 2016-02-28 rlar <rlar> * src/dfa.c, src/gen.c: cast to suite type of flex_uint32_t td_lolen 2016-02-28 rlar <rlar> * src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanopt.c, src/tables_shared.c: cast to get rid of warnings 2016-03-01 rlar <rlar> * src/buf.c, src/main.c: cast and fix usage of log10(), ceil to prevent buffer overflow 2016-03-01 rlar <rlar> * src/tables.c: tables.c, sprinkle casts to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_data_compress(), change type of local newsz to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c, src/tables.h: change type of struct yytbl_writer.total_written to get rid of warnings 2016-02-28 rlar <rlar> * src/tables.c: change argument type of yytbl_writen() to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_write8/16/32(), change type of local variables to get rid of warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/misc.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: change return type and rename int htoi()/otoi() --> unsigned int htoui()/otoui() 2016-03-01 Will Estes <westes575@gmail.com> * NEWS: Mention 2.6.1 release date 2016-02-28 rlar <rlar> * src/gen.c: avoid warning, add (int) cast to the read() return value For similiarity with the fread() case. 2016-02-28 rlar <rlar> * src/scan.l: avoid warning, POSIX says yyless() has an `int' argument 2016-02-29 rlar <rlar> * src/filter.c: use type size_t in filter_tee_header() to avoid warnings 2016-02-29 rlar <rlar> * src/filter.c, src/misc.c, src/scanopt.c, src/tables.c: add (size_t) casts to malloc invocations to prevent warnings 2016-02-29 rlar <rlar> * src/buf.c, src/misc.c, src/scan.l, src/scanopt.c, src/tables.c: add (int) casts to some strlen() invocations to prevent warnings 2016-02-29 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndlookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndinstal(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: cclinstal() and ccllookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/gen.c: warning: redundant redeclaration of ‘gen_next_state’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/gen.c: warning: no previous prototype for ‘mkecstbl’ [-Wmissing-prototypes] 2016-02-28 rlar <rlar> * src/main.c: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yywrap’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yylval’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yyin’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h, src/main.c: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: unification, rename some more rename these too for improved similiarity: OPTION_OP OPT_HEADER OPT_EXTRA_TYPE OPT_TABLES 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: fix name clash, OPT_OUTFILE from parse.y and from options.h these collide: OPT_OUTFILE OPT_PREFIX OPT_YYCLASS rename them TOK_... in the parser 2016-02-28 Will Estes <westes575@gmail.com> * lib/reallocarray.c: Prototyped reallocarray implementation 2016-02-28 Will Estes <westes575@gmail.com> * src/scanopt.c: Removed custom strcasecmp() function 2016-02-28 rlar <rlar> * src/flex.skl: fwrite wants a size_t, yyleng is int per posix 2016-02-28 rlar <rlar> * src/scanopt.c: Remove some unneeded casts 2016-02-28 rlar <rlar> * src/flexdef.h: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion] 2016-02-27 rlar <rlar> * src/dfa.c, src/parse.y: dfa.c:157:24: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] most certainly safe cast 2016-02-27 rlar <rlar> * src/ccl.c: ccl.c:86:19: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion] ch seems to have been checked for proper range some lines above 2016-02-27 rlar <rlar> * tests/bison_nr_parser.y: warning: deprecated directive, use '%pure-parser' [-Wdeprecated] 2016-02-27 rlar <rlar> * lib/lib.c: warning: no previous prototype for 'do_nothing' [-Wmissing-prototypes] 2016-02-27 rlar <rlar> * src/libmain.c: included stdlib.h header 2016-02-27 Will Estes <westes575@gmail.com> * NEWS: Described more post v2.6.0 changes 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: build: Removed bzip2 distribiution archive 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: removed obsolete program check 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: Made some program checks more robust 2016-02-27 rlar <rlar> * src/flex.skl: Remove unneeded cast to int 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fixed incorrect integer type 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fix more integer types, resolves sf 184, 187 2016-02-26 Robert Larice <Robert.Larice@t-online.de> * src/flex.skl, src/gen.c: Removed some type conversion warnings 2016-02-26 Will Estes <westes575@gmail.com> * src/flex.skl: Changed another buffer size to int; resolves gh#61 2016-02-24 Will Estes <westes575@gmail.com> * src/flex.skl: Changed type of yy_n_chars to int; gh#53, sf#160. The variable yy_n_chars had been of type yy_size_t which is incorrect given its use in read(). While it might be adviseable to look at defining a yy_ssize_t, there might be some issues doing this and so, for now, at least, we'll punt back to int. 2016-02-24 Will Estes <westes575@gmail.com> * src/buf.c: Fixed size of bufferallocation, resolved gh#54. The value of n_alloc was a count, not a size. Multiplying the value by the element size was incorrect. That multiplication was already being done and having it done twice was incorrect. 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/scan.l: Allow '%option noline' in flex input file, resolves gh#56. Allow specifying '%option noline' in the input file, leading to the same effect as calling flex with the command line option --noline. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/buf.c, src/main.c: Emit no #line directives if gen_line_dirs is false, resolves igh#55. There are two instances in the code which will print a #line directive to the resulting lexer, regardless of the value of gen_line_dirs. Fix them, so they also respect gen_line_dirs. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-16 Tobias Klauser <tklauser@distanz.ch> * lib/lib.c, src/gen.c, src/misc.c, src/scan.l: Converted K&R style function definitions to ANSI C style Consistently make use of the ANSI C function definition style instead of the K&R style. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Used NULL constant instead of plain integer for NULL pointer. The sparse static checker warns about using plain integer 0 as NULL pointers in the generated lexer code. Fix this by using NULL consistently for pointers. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Marked declaration and definition of yy_fatal_error as noreturn. Only the declaration of yy_fatal_error is marked with __attribute__((__noreturn__)) in case GCC >= 3 is used, but not the definition. This leads to the sparse static checker to complain about function declaration mismatch. Fix it by defining a macro yynoreturn and using it for both the declaration and the definition of yy_fatal_error. 2016-01-27 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Fixed declaration mismatch in yy_fatal_error. The prototype declares yy_fatal_error parameter as "const char msg[]" while the definition uses "const char* msg" (introduced by commit e9d5fc713f61b) which causes the sparse static checkers to produce an error. Fix this by adjusting the definition to use "const char* msg" as well. Also change the C++ version accordingly so it matches the declaration in FlexLexer.hpp. 2016-01-23 Will Estes <westes575@gmail.com> * CODE_OF_CONDUCT.md: flex is for flex #NCoC 2016-01-18 Will Estes <westes575@gmail.com> * doc/flex.texi: Referred to github for issue tracking, no longer sf 2016-01-10 Egor Pugin <egor.pugin@gmail.com> * tests/reject.l4, tests/tableopts.l4: Opened files in binary mode explicitly 2016-01-08 OBATA Akio <obache@NetBSD.org> * src/Makefile.am: Linked flex binary against libintl, not libfl. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> 2016-01-08 Michael van Elst <mlelstv@NetBSD.org> * src/filter.c: Improved pipe-stdin hack behavior; resolves sf#198. Signed-off-by: Thomas <Klausner wiz@NetBSD.org> 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac, src/flexdef.h: Removed no longer needed header checks 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac: Checked for reallocarray() with AC_REPLACE_FUNCS 2015-12-27 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: include libgen.h from flexdef.h, not main.c 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Replace basename2() with basename(3). Given the following program: \#include <libgen.h> \#include <stdio.h> /* extracts basename from path, optionally stripping the extension "\.*" * (same concept as /bin/sh `basename`, but different handling of extension). */ static char *basename2 (char *path) { char *b; for (b = path; *path; path++) if (*path == '/') b = path + 1; return b; } static void basename_compare(char *path) { printf("basename: %s\n", basename(path)); printf("basename2: %s\n\n", basename2(path)); } int main (int argc, char *argv[]) { // From http://pubs.opengroup.org/onlinepubs/9699919799/ // ``Sample Input and Output Strings'' basename_compare("/usr/lib"); basename_compare("/usr/"); basename_compare("/"); basename_compare("///"); basename_compare("//usr//lib//"); return 0; } ... and the program's output: basename: lib basename2: lib basename: usr basename2: basename: / basename2: basename: / basename2: basename: lib basename2: ... we can see that basename2() behaves the same as basename(3) in the average use case, but messes up pretty severely in others. Besides that, basename(3) is mandated by POSIX so should be present on modern Unix-like systems, so we shouldn't define it ourselves. Some notes: - it doesn't appear to be mentioned in POSIX, but OpenBSD's basename(3) returns NULL if the returned path componenet is > PATH_MAX, so add a check for that - basename(3) shouldn't return an empty string, so remove the program_name[0] != '\0' check 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Simplify basename2(). It's only call site does not activate the `strip_ext` code path, so the function can be simplified a lot. While here, remove a double assignment. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flex.skl, src/misc.c: Cleaned up __STDC__ #ifdefs. Assuming a compiler conforming to the ISO C standard is used, i.e., __STDC__ is defined to 1, YY_USE_CONST is always defined and can be eliminated. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flexdef.h, src/main.c, src/scanopt.c, src/scanopt.h, src/sym.c: Remove remaining use of PROTO 2015-12-21 Serguey Parkhomovsky <xindigo@gmail.com> * src/buf.c: buf.c: use snprintf 2015-12-19 Will Estes <westes575@gmail.com> * configure.ac: build: reformatted AC_CHECK_FUNCS for readability 2015-12-17 Will Estes <westes575@gmail.com> * src/scanopt.c: correct function prototype 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c, src/scanopt.c, src/sym.c, src/tblcmp.c: Remove more instances of PROTO 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c: Removed prototype for main(). It's not called anywhere else so the prototype is not needed. See the C99 standard [1], section 5.1.2.2.1 for more info. [1]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/dfa.c, src/gen.c, src/nfa.c, to.do/unicode/main.c, to.do/unicode/tblcmp.c: Removed more instances of PROTO, ansifying. 2015-12-13 Will Estes <westes575@gmail.com> * README: Noted github for issue tracking and pull requests 2015-12-13 Michael McConville <mmcco@mykolab.com> * README: Reformatted README; removed sf bug tracking link. 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/gen.c, to.do/unicode/gen.c: Removed macros for indentation level. Just increment or decrement the indentation counter. That's less to remember and makes the code more readable. w# Please enter the commit message for your changes. Lines starting 2015-12-12 Mike Frysinger <vapier@gentoo.org> * tests/Makefile.am, tests/testwrapper.sh: tests: fixed paths to input files. The current test wrapper works only when the inputs are specified using relative paths. If they're specified with absolute paths, the driver fails to detect the inputs because it always prepends the input dir name which itself is a relative path: $ cd tests $ ./testwrapper.sh -d . -i $PWD/reject.txt -t ./reject_ver.table <fails to open inputs> This normally doesn't show up because people run `./configure` or, for out of tree builds, `../configure`. But if you happen to run configure with an absolute path, then automake tends to generate absolute paths as well leading to test failures. Fix all of this by dropping the implicit input directory prepending. - INPUT_NAME is often a list of files, not just a single one - the input directory is used to find the testname tables which are usually generated, so it's impossible to use files from both source and build directories - most of the time, the full/correct path is already specified 2015-12-12 Mike Frysinger <vapier@gentoo.org> * configure.ac: configure: fixed realloc test. The [] characters are used for quoting in m4, so the attempt to use them in place of `test` fails yielding the warning at build time: .../flex/configure: line 20222: no: command not found 2015-12-12 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Started removal of PROTO macro. The PROTO macro is no longer needed. Additionally, its usage is inconsistent, so we began removing it. 2015-12-12 Michael Reed <m.reed@mykolab.com> * Makefile.am, src/main.c: Removed SHORT_FILE_NAMES preprocessor symbol. As a relic of MS-DOS, we don't need this. It's never defined; see 13b5b214f53d1c3354a7ab910bd160c126df1331. Removed additional MSDOS ifdef. 2015-12-11 Michael McConville <mmcco@mykolab.com> * configure.ac, lib/reallocarray.c, src/flexdef.h: Added new function reallocarray. This is taken from OpenSSH Portable, which in turn takes it from OpenBSD. reallocarray wraps the stdlib's realloc function. It takes two size arguments and checks for overflow, like calloc, but doesn't zero the memory. Therefore, it allows us to do overflow-safe array reallocations and overflow-safe unzeroed array allocations, which the stdlib allocation functions don't. We have a bunch of specific array allocation macros, none of which check for overflow. reallocarray should be able to replace them. 2015-12-11 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Removed MS-DOS, VMS macros. Given the age of the MS-DOS and VMS platforms, it's likely that no one is building flex on them any more. Additionally, the preferred approach is to test for particular platform features rather than to test for particular platforms. 2015-12-12 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: Made search for m4 more explicit. 2015-12-12 Will Estes <westes575@gmail.com> * src/flex.skl: Returned 0 from yywrap() instead of EOF 2015-12-11 Will Estes <westes575@gmail.com> * src/libmain.c: Changed end of main() in libmain to exit(0) 2015-12-11 Will Estes <westes575@gmail.com> * NEWS, configure.ac: Mentioned v2.6.1; documented some changes since v2.6.0 2015-12-11 Will Estes <westes575@gmail.com> * README: Updated build documentation; finished sf#155. Removed version numbers for build tools. Noted that version requirements for build tools will be noted in configure.ac. Expanded documentation of building texinfo based docs. 2015-12-11 Will Estes <westes575@gmail.com> * doc/Makefile.am: Removed flex.pdf from distribution; partially fixed sf#155 2015-12-11 Will Estes <westes575@gmail.com> * src/flex.skl: Commented in C style in skeleton; fixed sf#195 2015-12-10 Will Estes <westes575@gmail.com> * .gitignore: Ignored autoscan files 2015-12-09 Will Estes <westes575@gmail.com> * configure.ac: Checked for ranlib and strdup() at configure time 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/tblcmp.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/tblcmp.c: Replace zero_out() with stdlib's memset. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flex.skl: Removed memory allocation casts. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed alloca() configuration. Since alloca() is dangerous, depricated, we remove it. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed implementation of isascii(). POSIX defines isascii(), so it's likely present on anything weactually build flex on these days. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/main.c, src/scanopt.c, src/tables.c: Removed NULL-checks before free() 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/flexdef.h, src/gen.c, src/scan.l, to.do/unicode/flexdef.h, to.do/unicode/scan.l: Removed flex_free()i, corrected buf_destroy logic. As with flex_alloc(), replace with direct calls to free(). The function buf_destroy is now null safe and the logic was corrected to free() correctly. 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/filter.c, src/flexdef.h, src/misc.c, src/scan.l, src/scanflags.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_realloc(). As with flex_alloc(), replace calls to flex_realloc(), which was just a wrapper around realloc(). 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanflags.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_alloc; cleaned up style. The function flex_alloc() was just a wrapper around malloc(). Since this only added unclarity, and the flex_alloc() function is likely a legacy of olden times, remove it in favor of calls to malloc() directly. Style elements cleaned up: * superfluous spacing around parentheses * non-constant initialization in variable declarations * needless casts * almost all uses of assignments as subexpressions 2015-12-07 Michael McConville <mmcconville@mykolab.com> * src/dfa.c, src/flexdef.h, src/gen.c, src/main.c, src/scan.l, src/scanopt.c, tests/bison_nr_scanner.l, tests/bison_yylloc_scanner.l, tests/bison_yylval_scanner.l, tests/mem_nr.l, tests/mem_r.l, tests/pthread.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l, to.do/unicode/scan.l: Remove allocation casts 2015-12-07 Will Estes <westes575@gmail.com> * src/.gitignore, src/Makefile.am: Built flex with itself. Changes in scan.l need to be built into flex with the same version of flex in some cases. Since this build requirement is minimal, we simply bootstrap flex unconditionally. We intentionally exclude from version control the bootstrap artifacts as the extra copy of the lexer, the intermediate scanner and the bootstrap executable are not of interest. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, to.do/unicode/main.c, to.do/unicode/scan.l: Use NULL rather than (type *) 0. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: Replace copy_unsigned_string() with xstrdup(). Like copy_string(), copy_unsigned_string() is just a clone of the stlib's strdup(). We only use it twice. I'm pretty confident that char signedness is irrelevant in this case. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Cleaned up white space. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Removed struct keyword before yy_buffer_state 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * examples/testxxLexer.l, src/FlexLexer.h, src/flex.skl, src/main.c: Replaced FLEX_STD macro with std::. The std:: construct exists as of C++98, so we can simply assume it is supported. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/Makefile.am: Generated skel.c explicitly in srcdir. Rewrote the target for skel.c to explicitly mention the srcdir. This should help when building flex from a directory outside the flex tree. Spread the rule out over several lines to enhance readability. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * autogen.sh: Called glibtoolize if libtoolize run fails. On Mac OS X, libtoolize is known as glibtoolize. In cases where libtoolize is not present, then calling glibtoolize when bootstrapping the build system gives more folks a shot at getting flex built from the ground up. 2015-12-02 Mightyjo <mightyjo@gmail.com> * configure.ac: Checked for (g)texi2dvi. Better bison, help2man checks. Added test for presence of (g)texi2dvi program. Gave notice if texi2dvi is unavailable and set TEXI2DVI=: to avoid giving users headaches. Enhanced tests for bison and help2man with notices when the programs aren't found. Set their program variables to use the missing script in build-aux since it's compatible with them. 2015-12-02 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/parse.y, src/scan.l, src/sym.c, src/tables.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Made string copying more standard. copy_string() was a clone of the stdlib's strdup(). For safety, simplicity, and speed, we should use that instead. We introduce xstrdup() which wraps strdup() in a failure upon memory allocation errors. 2015-11-30 Serguey Parkhomovsky <sergueyparkhomovsky@gmail.com> * src/scan.l: Error on unbalanced parentheses in rules section. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Cleaned up BUILT_SOURCES list. Removed reference to skel.c as a built source since other make rules cover this case. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Sorted file names in flex_SOURCES 2015-11-27 Mightyjo <mightyjo@gmail.com> * src/ecs.c, src/flexdef.h, src/main.c, src/misc.c, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Replaced CHAR macro with unsigned char type. Thanks to Michael McConville for pointing out that the old Char macro causes problems with static analysis. The macro has been removed and replaced with 'unsigned char' throughout the flex sources. The macro is not needed at best and was confusing at worst. It was not used in any of the example files nor was it mentioned in the manual at all. 2015-11-21 Will Estes <westes575@gmail.com> * configure.ac: updated syntax of AC_INIT call as per autoupdate 2015-11-21 Will Estes <westes575@gmail.com> * tests/Makefile.am: removed extra call to a _CPPFLAGS variable 2015-05-14 Stefan Reinauer <stefan.reinauer@coreboot.org> * src/buf.c, src/ccl.c, src/dfa.c, src/ecs.c, src/gen.c, src/main.c, src/misc.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Switch function definitions from mixed K&R to consistent ANSI C. flex was using K&R function definitions for some functions and ANSI C style in others, sometimes even in the same file. Change the code to consistently use ANSI C. Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> 2015-11-16 Mightyjo <mightyjo@gmail.com> * tests/Makefile.am: Used in-tree header file for c++ tests.
2017-01-02 19:26:30 +03:00
printf("Testing: test_scan_bytes(%s): ",INPUT_STRING_2); fflush(stdout);
testlex_init(&scanner);
state = test_scan_bytes ( INPUT_STRING_2, 12 ,scanner);
testlex(scanner);
test_delete_buffer(state,scanner);
testlex_destroy(scanner);
2016-01-09 18:43:18 +03:00
/* Scan directly from a buffer.
We make a copy, since the buffer will be modified by flex.*/
2016-12-30 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS for 2.6.3 release 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: New configure option '--disable-bootstrap'. If configure is run with '--disable-bootstrap', then stage1flex won't be built and stage1scan.c will be generated by sed'ing scan.c. This option is intended to workaround bootstrap bugs rather than to fix the bootstrapping issues which are proving subtler and harder to fix than anyone would like. 2016-11-26 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: "make clean" deletes stage1scan.c, stage1flex 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: allow building libfl even with --disable-libfl. For various reasons, we may wish to build libfl explicitly even when configure has been run with the --disable-libfl option. This is possible, now, via 'make -C src libfl.la'. 2016-12-19 Alexis La Goutte <alexis.lagoutte@gmail.com> * src/flex.skl: scanner: remove trailing whitespace in skeleton 2016-12-01 Demi Obenour <demiobenour@gmail.com> * src/buf.c, src/main.c, src/parse.y: scanner: Disallow, overquote '[' and ']' in prefix 2016-12-29 Samuel Thibault <samuel.thibault@ens-lyon.org> * src/main.c: scanner: allocate correct buffer size for m4 path. Flex did not check the length of the m4 path which could lead to a buffer overflow in some cases. Additionally, not all platforms believe in PATH_MAX, so stop relying on it. Fixes #138 2016-11-24 Will Estes <westes575@gmail.com> * NEWS: doc: note no more libcompat in NEWS 2016-11-24 Will Estes <westes575@gmail.com> * lib/Makefile.am: build: explain empty lib/Makefile.am 2016-11-20 Explorer09 <explorer09@gmail.com> * configure.ac: build: warn about cross compiling with *alloc 2016-11-19 Explorer09 <explorer09@gmail.com> * configure.ac, lib/Makefile.am, lib/lib.c, src/Makefile.am: build: Link $(LIBOBJS) from src/ dir, remove libcompat.la. The libcompat.la library was small and less friendly to bootstrapping and cross compilation. Now, we will simply link individual object files as needed, which is simpler. 2016-11-16 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: Let stage1flex respect LFLAGS 2016-11-14 Will Estes <westes575@gmail.com> * NEWS: doc: describe --disable-libfl in NEWS 2016-10-31 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: Add --disable-libfl configure option. Disabling libfl is useful when building flex for a cross-toolchain. Fixes: GH-99 2016-11-09 Demi Obenour <demiobenour@gmail.com> * src/flex.skl, tests/array_r.l: fix backwards incompatible changes in 2.6.2. This patch addscompatibility `#defines` for all macros affected by `%prefix`. Fixes #113. 2016-11-08 Will Estes <westes575@gmail.com> * tests/.gitignore: git: ignore quote_in_comment artifacts 2016-11-08 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/Makefile.am, tests/quote_in_comment.l, tests/quote_in_comment.txt: Fixes a major bug in Flex's own lexing of literals. My changes caused Flex to mishandle string and character literals in line comments. This commit fixes them. Fixes #113. 2016-11-06 Thomas Klausner <wiz@NetBSD.org> * configure.ac: Fix unportable test(1) operator. "==" is only supported by bash, "=" is the standard comparison operator. 2016-11-02 Demi Obenour <demiobenour@gmail.com> * tests/quotes.l: Add more escaping tests 2016-11-01 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix another escaping bug in non-indented verbatim section 2 code. I also did some reformatting. 2016-10-28 Alastair Hughes <hobbitalastair@gmail.com> * configure.ac: build: fix false negatives for help2man and texi2dvi HELP2MAN and TEXI2DVI (or the corresponding ac_prog variables) will never be zero length as they fall back to the missing script; check for the fall back and warn on that instead of always warning. 2016-10-28 Explorer09 <explorer09@gmail.com> * doc/Makefile.am: doc: Don't delete flex.1 during "make distclean". flex.1 is pre-generated in release tarball. If we delete it, the next "configure and make" on the source directory will then require help2man unnecessarily. 2016-10-27 Alastair Hughes <hobbitalastair@gmail.com> * NEWS, doc/Makefile.am: Only regenerate the man page when required. Make the flex binary an order-only prerequisite, and add back the prerequisites from before 7cfb440. This prevents rebuilding the man page whenever the flex binary is rebuilt, which causes problems if help2man is not installed and will never work when cross compiling. Fixes #108. 2016-10-26 Will Estes <westes575@gmail.com> * NEWS, src/Makefile.am: build: no longer build PIC version of libfl. The PIC version of libfl was not being built correctly. From the lack of bug reports around this problem, we conclude that the PIC version of libfl is not used and so we drop it from the build build targets for flex. 2016-10-25 Explorer09 <explorer09@gmail.com> * README.md: doc: README.md formatting fixes * Wrap everything in the raw document in 72 char per line limit. * Proper casing for terms "Git" and "GitHub" (don't try to look lazy). * Add unordered list marks when needed. * Say `configure && make && make install` and quoted for fixed-width font. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> 2016-10-25 Will Estes <westes575@gmail.com> * NEWS, configure.ac: build: version 2.6.3 begins 2016-10-24 Will Estes <westes575@gmail.com> * NEWS: doc: mark 2.6.2 release date 2016-10-24 Will Estes <westes575@gmail.com> * .gitignore, NEWS, configure.ac: build: switch xz to lzip 2016-10-20 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/quotes.l: Fix M4 quotation in section 2 prologue and refactor duplicated code 2016-10-21 Alex Kennedy <alexzanderkennedy@gmail.com> * doc/flex.texi: Update flex.texi: Removed repedative wording "Flex used to" was written twice at the beginning of Chapter 9, paragraph 2. 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/dfa.c, src/gen.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, tests/bison_yylval_scanner.l, tests/include_by_push.direct.l: Improved M4 quotation This fixes M4 quotation of certain strings beginning with `yy` (in section 3 of the input file only) and character literals. The new quotation method is also less brittle and faster. Tests that relied on the old behavior were fixed. Also, `yyconst` is no longer defined; use `const` (which it unconditionally was defined to) instead. 2016-10-19 Will Estes <westes575@gmail.com> * Makefile.am, configure.ac: build: for automake, flex is foreign 2016-10-19 Will Estes <westes575@gmail.com> * README, README.md: doc: mv README to README.md 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: touch up README 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: README no longer mentions sourceforge 2016-10-06 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS with more post-2.6.1 additions 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/options.c, src/options.h, src/scan.l, src/yylex.c, tests/Makefile.am, tests/alloc_extra.l, tests/array_r.l, tests/basic_r.l, tests/c_cxx_nr.lll, tests/c_cxx_r.lll, tests/debug_r.l, tests/include_by_reentrant.direct.l, tests/lineno_r.l, tests/mem_nr.l, tests/mem_r.l, tests/posix.l, tests/posixly_correct.l, tests/pthread.l, tests/quotes.l, tests/reject.l4, tests/rescan_nr.direct.l, tests/rescan_r.direct.l, tests/string_nr.l, tests/string_r.l: Fix M4 quoting of section 3. This fixes M4 quoting of section 3 of the input file, including escape sequences and character constants. Tests were added to verify the behavior in section 3 with respect to quoting. Both escaping of quotes and quoting of potential macro-start characters are tested. Existing tests were also fixed to account for the new -- and now correct -- behavior. Many tests relied on the old behavior of expanding M4 macros in section 3. They needed to be updated for the new behavior. 2016-10-03 Mightyjo <mightyjo@gmail.com> * src/flex.skl, tests/.gitignore, tests/Makefile.am, tests/cxx_restart.ll, tests/cxx_restart.txt: Fix yyrestart(NULL) SEGV. 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/scan.l: scanner: M4 quoting fixes 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am: Support `make indent` for out of source builds 2016-09-24 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am, src/mkskel.sh: Simplify some shell code 2016-09-23 Demi Obenour <demiobenour@gmail.com> * doc/flex.texi, src/flex.skl, src/flexdef.h, src/main.c, src/options.c, src/options.h, src/scan.l, tests/.gitignore, tests/Makefile.am, tests/noansi_nr.l, tests/noansi_nr.txt, tests/noansi_r.l, tests/noansi_r.txt: no longer generate K&R C scanners 2016-09-04 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix escaping of `[[` and `]]` in strings Previously, `[[` and `]]` were not escaped in strings, which led to bad interactions with m4. Also, don't break strings on newline, as GCC et al support whitespace between a backslash and the subsequent newline. 2016-06-20 Translation Project <coordinator@translationproject.org> * NEWS, po/sv.po: new sv translation 2016-05-23 Demetri Obenour <demiobenour@gmail.com> * src/misc.c: Delete action_m4_define from misc.c This function was not used and always triggered a fatal error when run. 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am, tests/testwrapper-direct.sh: test: run direct tests from srcdir 2016-01-11 Egor Pugin <egor.pugin@gmail.com> * tests/include_by_buffer.direct.l, tests/include_by_push.direct.l, tests/include_by_reentrant.direct.l: Exited with error code on some conditions in include tests 2016-05-20 Will Estes <westes575@gmail.com> * tests/testwrapper.sh: test: drop .exe when making input file names 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am: test: removed dependencies for include tests 2016-04-28 Tobias Klauser <tklauser@distanz.ch> * src/scanflags.c: Avoid realloc on every call of sf_push() Currently, every call to sf_push() realloc()'s _sf_stack, even if the maximum size _sf_max wasn't changed. As the indentation beneath the "if" clause already indicates, the realloc() should only be executed if _sf_max was increased. Found by compiling flex with the -Wmisleading-indentation flags of gcc, which leads to the following warning: scanflags.c: In function ‘sf_push’: scanflags.c:42:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (_sf_top_ix + 1 >= _sf_max) ^~ scanflags.c:44:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ _sf_stk = realloc(_sf_stk, sizeof(scanflags_t) * _sf_max); ^~~~~~~ 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: prettified command to build man page 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: added man page to DISTCLEANFILES 2016-03-31 Will Estes <westes575@gmail.com> * BUGS, TODO: remove unused TODO, BUGS files 2016-03-31 Will Estes <westes575@gmail.com> * to.do/README, to.do/Wilhelms.todo, to.do/Wish-List, to.do/flex.rmail, to.do/streams.mail, to.do/unicode/FlexLexer.h, to.do/unicode/ccl.c, to.do/unicode/changes.txt, to.do/unicode/ecs.c, to.do/unicode/flex.1, to.do/unicode/flex.skl, to.do/unicode/flexdef.h, to.do/unicode/gen.c, to.do/unicode/main.c, to.do/unicode/misc.c, to.do/unicode/scan.l, to.do/unicode/tblcmp.c: removed to.do/ directory 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: removed flex.skl from POTFILES.in file list 2016-03-31 rlar <rlar> * src/Makefile.am: fix skel.c dependency (missing tables_shared.c) and polish build rule Also remove references to srcdir since skel.c is no longer mentioned in po/POTFILES.in. 2016-03-31 rlar <rlar> * doc/Makefile.am: fix flex.1 dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 && \ make dist failed with: > help2man: can't get `--help' info from ../../flex/src/flex Note: There is no dependency except for the flex binary. 2016-03-31 rlar <rlar> * src/Makefile.am: fix stage1scan.c and stage1scan.l dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 failed with: > ../src/stage1flex -o stage1scan.c stage1scan.l > stage1flex: can't open stage1scan.l Note: stage1scan.c is not necessairy in the "make dist" generated tar.gz file. stage1flex will be build from scan.c (which is distributed), and this will then generate stage1scan.c from scan.l 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: list src/flex.skl in po/POTFILES.in 2016-03-29 rlar <rlar> * src/gen.c: warning in generated code, with -Ca warning: conversion to 'yy_state_type' from 'flex_uint32_t' may change the sign of the result [-Wsign-conversion] 2016-03-29 rlar <rlar> * tests/Makefile.am: suppress `WARNINGFLAGS' for the almost obsolete `noansi' test cases 2016-03-29 rlar <rlar> * configure.ac, src/Makefile.am, tests/Makefile.am: configure option `--enable-warnings' and `WARNINGFLAGS' `WARNINGFLAGS' can be passed when invoking `configure' and when invoking `make' if configure switch `--enable-warnings' was given then default to something useful if we have `GCC' `WARNINGFLAGS' is not used when compiling `stage1flex' to avoid unnecessary clutter 2016-03-31 Tobias Klauser <tklauser@distanz.ch> * src/main.c: Fix potential buffer overflow in strncat() When using clang/llvm 3.8 to compile flex, the following warning is emitted: main.c:378:27: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size] strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ main.c:378:27: note: change the argument to be the free space in the destination buffer minus the terminating null byte strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ sizeof(m4_path) - strlen(m4_path) - 1Fix it up by using the solution proposed by the warning message. 2016-03-29 Robert.Larice Robert Larice <Robert.Larice@t-online.de> * src/Makefile.am: build: simplified dependency tracking so parallel make runs succeed 2016-03-20 rlar <rlar> * src/flex.skl, src/gen.c, src/main.c: avoid warning in generated code, with -Cf warning: conversion to 'unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-18 Will Estes <westes575@gmail.com> * NEWS, configure.ac: mention v2.6.2; summarize changes since 2.6.1 2016-03-18 Will Estes <westes575@gmail.com> * doc/flex.texi: doc: corrected example in manual, gh#67 2016-03-16 rlar <rlar> * tests/string_nr.l, tests/string_r.l, tests/yyextra.l: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * tests/mem_nr.l, tests/mem_r.l, tests/pthread.l: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * src/flex.skl: warning: conversion to 'flex_uint32_t' from 'long unsigned int' may alter its value [-Wconversion] struct yytbl_reader, member bread is of type flex_uint32_t 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/bison_nr_main.c, tests/bison_nr_parser.y, tests/bison_yylloc_parser.y: warning: redundant redeclaration of '...' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/bison_nr_parser.y, tests/bison_yylloc_parser.y, tests/bison_yylval_parser.y, tests/pthread.l: warning: no previous prototype for '...' [-Wmissing-prototypes] 2016-03-16 rlar <rlar> * tests/multiple_scanners_r_main.c: warning: unused variable 'fp' [-Wunused-variable] 2016-03-16 rlar <rlar> * tests/pthread.l: main(), warning: redundant redeclaration of 'main' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/include_by_reentrant.direct.l, tests/lineno_nr.l, tests/lineno_r.l, tests/lineno_trailing.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/array_nr.l, tests/array_r.l, tests/basic_nr.l, tests/basic_r.l, tests/ccl.l, tests/debug_nr.l, tests/debug_r.l, tests/extended.l, tests/mem_nr.l, tests/mem_r.l, tests/noansi_r.l, tests/posix.l, tests/posixly_correct.l, tests/prefix_nr.l, tests/prefix_r.l, tests/quotes.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-01 rlar <rlar> * src/ecs.c, src/tblcmp.c: Fix two more casts 2016-03-14 Bastian Köcher <git@kchr.de> * src/gen.c: Fixes yyl compare with unsigned warning 2016-03-13 Robert Larice <Robert.Larice@t-online.de> * configure.ac: Suppress portability warnings in Makefile generation 2016-02-27 rlar <rlar> * src/flex.skl: generated code, in yyensure_buffer_stack(), change type of local `num_to_alloc' which is exclusively used in yy_size_t context 2016-03-01 rlar <rlar> * src/flex.skl: generated code, in yy_get_next_buffer(), change type of local `number_to_move' suits better, because `yy_n_chars' and `yy_buf_size' are of type `int' 2016-02-27 rlar <rlar> * src/flex.skl: generated code, `_yybytes_len' is of type `int', fix code accordingly 2016-02-28 rlar <rlar> * src/gen.c: generated code, `max_size' seems to be of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, here `new_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `yy_buf_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `offset' is of type `int' 2016-02-28 rlar <rlar> * src/gen.c: generated code, `yy_more_len' is of type `int' 2016-02-28 rlar <rlar> * src/scan.l: scan.l, rewrite two loops to avoid unneccesairy casting 2016-03-01 rlar <rlar> * src/regex.c, src/tables.c: improve readability 2016-02-28 rlar <rlar> * src/tblcmp.c: another cast in tblcmp.c to avoid warning 2016-02-28 rlar <rlar> * src/buf.c: casts in buf_append() to get rid of warnings 2016-02-28 rlar <rlar> * src/dfa.c, src/gen.c: cast to suite type of flex_uint32_t td_lolen 2016-02-28 rlar <rlar> * src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanopt.c, src/tables_shared.c: cast to get rid of warnings 2016-03-01 rlar <rlar> * src/buf.c, src/main.c: cast and fix usage of log10(), ceil to prevent buffer overflow 2016-03-01 rlar <rlar> * src/tables.c: tables.c, sprinkle casts to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_data_compress(), change type of local newsz to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c, src/tables.h: change type of struct yytbl_writer.total_written to get rid of warnings 2016-02-28 rlar <rlar> * src/tables.c: change argument type of yytbl_writen() to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_write8/16/32(), change type of local variables to get rid of warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/misc.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: change return type and rename int htoi()/otoi() --> unsigned int htoui()/otoui() 2016-03-01 Will Estes <westes575@gmail.com> * NEWS: Mention 2.6.1 release date 2016-02-28 rlar <rlar> * src/gen.c: avoid warning, add (int) cast to the read() return value For similiarity with the fread() case. 2016-02-28 rlar <rlar> * src/scan.l: avoid warning, POSIX says yyless() has an `int' argument 2016-02-29 rlar <rlar> * src/filter.c: use type size_t in filter_tee_header() to avoid warnings 2016-02-29 rlar <rlar> * src/filter.c, src/misc.c, src/scanopt.c, src/tables.c: add (size_t) casts to malloc invocations to prevent warnings 2016-02-29 rlar <rlar> * src/buf.c, src/misc.c, src/scan.l, src/scanopt.c, src/tables.c: add (int) casts to some strlen() invocations to prevent warnings 2016-02-29 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndlookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndinstal(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: cclinstal() and ccllookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/gen.c: warning: redundant redeclaration of ‘gen_next_state’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/gen.c: warning: no previous prototype for ‘mkecstbl’ [-Wmissing-prototypes] 2016-02-28 rlar <rlar> * src/main.c: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yywrap’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yylval’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yyin’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h, src/main.c: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: unification, rename some more rename these too for improved similiarity: OPTION_OP OPT_HEADER OPT_EXTRA_TYPE OPT_TABLES 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: fix name clash, OPT_OUTFILE from parse.y and from options.h these collide: OPT_OUTFILE OPT_PREFIX OPT_YYCLASS rename them TOK_... in the parser 2016-02-28 Will Estes <westes575@gmail.com> * lib/reallocarray.c: Prototyped reallocarray implementation 2016-02-28 Will Estes <westes575@gmail.com> * src/scanopt.c: Removed custom strcasecmp() function 2016-02-28 rlar <rlar> * src/flex.skl: fwrite wants a size_t, yyleng is int per posix 2016-02-28 rlar <rlar> * src/scanopt.c: Remove some unneeded casts 2016-02-28 rlar <rlar> * src/flexdef.h: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion] 2016-02-27 rlar <rlar> * src/dfa.c, src/parse.y: dfa.c:157:24: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] most certainly safe cast 2016-02-27 rlar <rlar> * src/ccl.c: ccl.c:86:19: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion] ch seems to have been checked for proper range some lines above 2016-02-27 rlar <rlar> * tests/bison_nr_parser.y: warning: deprecated directive, use '%pure-parser' [-Wdeprecated] 2016-02-27 rlar <rlar> * lib/lib.c: warning: no previous prototype for 'do_nothing' [-Wmissing-prototypes] 2016-02-27 rlar <rlar> * src/libmain.c: included stdlib.h header 2016-02-27 Will Estes <westes575@gmail.com> * NEWS: Described more post v2.6.0 changes 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: build: Removed bzip2 distribiution archive 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: removed obsolete program check 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: Made some program checks more robust 2016-02-27 rlar <rlar> * src/flex.skl: Remove unneeded cast to int 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fixed incorrect integer type 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fix more integer types, resolves sf 184, 187 2016-02-26 Robert Larice <Robert.Larice@t-online.de> * src/flex.skl, src/gen.c: Removed some type conversion warnings 2016-02-26 Will Estes <westes575@gmail.com> * src/flex.skl: Changed another buffer size to int; resolves gh#61 2016-02-24 Will Estes <westes575@gmail.com> * src/flex.skl: Changed type of yy_n_chars to int; gh#53, sf#160. The variable yy_n_chars had been of type yy_size_t which is incorrect given its use in read(). While it might be adviseable to look at defining a yy_ssize_t, there might be some issues doing this and so, for now, at least, we'll punt back to int. 2016-02-24 Will Estes <westes575@gmail.com> * src/buf.c: Fixed size of bufferallocation, resolved gh#54. The value of n_alloc was a count, not a size. Multiplying the value by the element size was incorrect. That multiplication was already being done and having it done twice was incorrect. 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/scan.l: Allow '%option noline' in flex input file, resolves gh#56. Allow specifying '%option noline' in the input file, leading to the same effect as calling flex with the command line option --noline. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/buf.c, src/main.c: Emit no #line directives if gen_line_dirs is false, resolves igh#55. There are two instances in the code which will print a #line directive to the resulting lexer, regardless of the value of gen_line_dirs. Fix them, so they also respect gen_line_dirs. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-16 Tobias Klauser <tklauser@distanz.ch> * lib/lib.c, src/gen.c, src/misc.c, src/scan.l: Converted K&R style function definitions to ANSI C style Consistently make use of the ANSI C function definition style instead of the K&R style. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Used NULL constant instead of plain integer for NULL pointer. The sparse static checker warns about using plain integer 0 as NULL pointers in the generated lexer code. Fix this by using NULL consistently for pointers. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Marked declaration and definition of yy_fatal_error as noreturn. Only the declaration of yy_fatal_error is marked with __attribute__((__noreturn__)) in case GCC >= 3 is used, but not the definition. This leads to the sparse static checker to complain about function declaration mismatch. Fix it by defining a macro yynoreturn and using it for both the declaration and the definition of yy_fatal_error. 2016-01-27 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Fixed declaration mismatch in yy_fatal_error. The prototype declares yy_fatal_error parameter as "const char msg[]" while the definition uses "const char* msg" (introduced by commit e9d5fc713f61b) which causes the sparse static checkers to produce an error. Fix this by adjusting the definition to use "const char* msg" as well. Also change the C++ version accordingly so it matches the declaration in FlexLexer.hpp. 2016-01-23 Will Estes <westes575@gmail.com> * CODE_OF_CONDUCT.md: flex is for flex #NCoC 2016-01-18 Will Estes <westes575@gmail.com> * doc/flex.texi: Referred to github for issue tracking, no longer sf 2016-01-10 Egor Pugin <egor.pugin@gmail.com> * tests/reject.l4, tests/tableopts.l4: Opened files in binary mode explicitly 2016-01-08 OBATA Akio <obache@NetBSD.org> * src/Makefile.am: Linked flex binary against libintl, not libfl. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> 2016-01-08 Michael van Elst <mlelstv@NetBSD.org> * src/filter.c: Improved pipe-stdin hack behavior; resolves sf#198. Signed-off-by: Thomas <Klausner wiz@NetBSD.org> 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac, src/flexdef.h: Removed no longer needed header checks 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac: Checked for reallocarray() with AC_REPLACE_FUNCS 2015-12-27 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: include libgen.h from flexdef.h, not main.c 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Replace basename2() with basename(3). Given the following program: \#include <libgen.h> \#include <stdio.h> /* extracts basename from path, optionally stripping the extension "\.*" * (same concept as /bin/sh `basename`, but different handling of extension). */ static char *basename2 (char *path) { char *b; for (b = path; *path; path++) if (*path == '/') b = path + 1; return b; } static void basename_compare(char *path) { printf("basename: %s\n", basename(path)); printf("basename2: %s\n\n", basename2(path)); } int main (int argc, char *argv[]) { // From http://pubs.opengroup.org/onlinepubs/9699919799/ // ``Sample Input and Output Strings'' basename_compare("/usr/lib"); basename_compare("/usr/"); basename_compare("/"); basename_compare("///"); basename_compare("//usr//lib//"); return 0; } ... and the program's output: basename: lib basename2: lib basename: usr basename2: basename: / basename2: basename: / basename2: basename: lib basename2: ... we can see that basename2() behaves the same as basename(3) in the average use case, but messes up pretty severely in others. Besides that, basename(3) is mandated by POSIX so should be present on modern Unix-like systems, so we shouldn't define it ourselves. Some notes: - it doesn't appear to be mentioned in POSIX, but OpenBSD's basename(3) returns NULL if the returned path componenet is > PATH_MAX, so add a check for that - basename(3) shouldn't return an empty string, so remove the program_name[0] != '\0' check 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Simplify basename2(). It's only call site does not activate the `strip_ext` code path, so the function can be simplified a lot. While here, remove a double assignment. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flex.skl, src/misc.c: Cleaned up __STDC__ #ifdefs. Assuming a compiler conforming to the ISO C standard is used, i.e., __STDC__ is defined to 1, YY_USE_CONST is always defined and can be eliminated. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flexdef.h, src/main.c, src/scanopt.c, src/scanopt.h, src/sym.c: Remove remaining use of PROTO 2015-12-21 Serguey Parkhomovsky <xindigo@gmail.com> * src/buf.c: buf.c: use snprintf 2015-12-19 Will Estes <westes575@gmail.com> * configure.ac: build: reformatted AC_CHECK_FUNCS for readability 2015-12-17 Will Estes <westes575@gmail.com> * src/scanopt.c: correct function prototype 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c, src/scanopt.c, src/sym.c, src/tblcmp.c: Remove more instances of PROTO 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c: Removed prototype for main(). It's not called anywhere else so the prototype is not needed. See the C99 standard [1], section 5.1.2.2.1 for more info. [1]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/dfa.c, src/gen.c, src/nfa.c, to.do/unicode/main.c, to.do/unicode/tblcmp.c: Removed more instances of PROTO, ansifying. 2015-12-13 Will Estes <westes575@gmail.com> * README: Noted github for issue tracking and pull requests 2015-12-13 Michael McConville <mmcco@mykolab.com> * README: Reformatted README; removed sf bug tracking link. 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/gen.c, to.do/unicode/gen.c: Removed macros for indentation level. Just increment or decrement the indentation counter. That's less to remember and makes the code more readable. w# Please enter the commit message for your changes. Lines starting 2015-12-12 Mike Frysinger <vapier@gentoo.org> * tests/Makefile.am, tests/testwrapper.sh: tests: fixed paths to input files. The current test wrapper works only when the inputs are specified using relative paths. If they're specified with absolute paths, the driver fails to detect the inputs because it always prepends the input dir name which itself is a relative path: $ cd tests $ ./testwrapper.sh -d . -i $PWD/reject.txt -t ./reject_ver.table <fails to open inputs> This normally doesn't show up because people run `./configure` or, for out of tree builds, `../configure`. But if you happen to run configure with an absolute path, then automake tends to generate absolute paths as well leading to test failures. Fix all of this by dropping the implicit input directory prepending. - INPUT_NAME is often a list of files, not just a single one - the input directory is used to find the testname tables which are usually generated, so it's impossible to use files from both source and build directories - most of the time, the full/correct path is already specified 2015-12-12 Mike Frysinger <vapier@gentoo.org> * configure.ac: configure: fixed realloc test. The [] characters are used for quoting in m4, so the attempt to use them in place of `test` fails yielding the warning at build time: .../flex/configure: line 20222: no: command not found 2015-12-12 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Started removal of PROTO macro. The PROTO macro is no longer needed. Additionally, its usage is inconsistent, so we began removing it. 2015-12-12 Michael Reed <m.reed@mykolab.com> * Makefile.am, src/main.c: Removed SHORT_FILE_NAMES preprocessor symbol. As a relic of MS-DOS, we don't need this. It's never defined; see 13b5b214f53d1c3354a7ab910bd160c126df1331. Removed additional MSDOS ifdef. 2015-12-11 Michael McConville <mmcco@mykolab.com> * configure.ac, lib/reallocarray.c, src/flexdef.h: Added new function reallocarray. This is taken from OpenSSH Portable, which in turn takes it from OpenBSD. reallocarray wraps the stdlib's realloc function. It takes two size arguments and checks for overflow, like calloc, but doesn't zero the memory. Therefore, it allows us to do overflow-safe array reallocations and overflow-safe unzeroed array allocations, which the stdlib allocation functions don't. We have a bunch of specific array allocation macros, none of which check for overflow. reallocarray should be able to replace them. 2015-12-11 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Removed MS-DOS, VMS macros. Given the age of the MS-DOS and VMS platforms, it's likely that no one is building flex on them any more. Additionally, the preferred approach is to test for particular platform features rather than to test for particular platforms. 2015-12-12 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: Made search for m4 more explicit. 2015-12-12 Will Estes <westes575@gmail.com> * src/flex.skl: Returned 0 from yywrap() instead of EOF 2015-12-11 Will Estes <westes575@gmail.com> * src/libmain.c: Changed end of main() in libmain to exit(0) 2015-12-11 Will Estes <westes575@gmail.com> * NEWS, configure.ac: Mentioned v2.6.1; documented some changes since v2.6.0 2015-12-11 Will Estes <westes575@gmail.com> * README: Updated build documentation; finished sf#155. Removed version numbers for build tools. Noted that version requirements for build tools will be noted in configure.ac. Expanded documentation of building texinfo based docs. 2015-12-11 Will Estes <westes575@gmail.com> * doc/Makefile.am: Removed flex.pdf from distribution; partially fixed sf#155 2015-12-11 Will Estes <westes575@gmail.com> * src/flex.skl: Commented in C style in skeleton; fixed sf#195 2015-12-10 Will Estes <westes575@gmail.com> * .gitignore: Ignored autoscan files 2015-12-09 Will Estes <westes575@gmail.com> * configure.ac: Checked for ranlib and strdup() at configure time 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/tblcmp.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/tblcmp.c: Replace zero_out() with stdlib's memset. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flex.skl: Removed memory allocation casts. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed alloca() configuration. Since alloca() is dangerous, depricated, we remove it. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed implementation of isascii(). POSIX defines isascii(), so it's likely present on anything weactually build flex on these days. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/main.c, src/scanopt.c, src/tables.c: Removed NULL-checks before free() 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/flexdef.h, src/gen.c, src/scan.l, to.do/unicode/flexdef.h, to.do/unicode/scan.l: Removed flex_free()i, corrected buf_destroy logic. As with flex_alloc(), replace with direct calls to free(). The function buf_destroy is now null safe and the logic was corrected to free() correctly. 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/filter.c, src/flexdef.h, src/misc.c, src/scan.l, src/scanflags.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_realloc(). As with flex_alloc(), replace calls to flex_realloc(), which was just a wrapper around realloc(). 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanflags.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_alloc; cleaned up style. The function flex_alloc() was just a wrapper around malloc(). Since this only added unclarity, and the flex_alloc() function is likely a legacy of olden times, remove it in favor of calls to malloc() directly. Style elements cleaned up: * superfluous spacing around parentheses * non-constant initialization in variable declarations * needless casts * almost all uses of assignments as subexpressions 2015-12-07 Michael McConville <mmcconville@mykolab.com> * src/dfa.c, src/flexdef.h, src/gen.c, src/main.c, src/scan.l, src/scanopt.c, tests/bison_nr_scanner.l, tests/bison_yylloc_scanner.l, tests/bison_yylval_scanner.l, tests/mem_nr.l, tests/mem_r.l, tests/pthread.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l, to.do/unicode/scan.l: Remove allocation casts 2015-12-07 Will Estes <westes575@gmail.com> * src/.gitignore, src/Makefile.am: Built flex with itself. Changes in scan.l need to be built into flex with the same version of flex in some cases. Since this build requirement is minimal, we simply bootstrap flex unconditionally. We intentionally exclude from version control the bootstrap artifacts as the extra copy of the lexer, the intermediate scanner and the bootstrap executable are not of interest. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, to.do/unicode/main.c, to.do/unicode/scan.l: Use NULL rather than (type *) 0. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: Replace copy_unsigned_string() with xstrdup(). Like copy_string(), copy_unsigned_string() is just a clone of the stlib's strdup(). We only use it twice. I'm pretty confident that char signedness is irrelevant in this case. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Cleaned up white space. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Removed struct keyword before yy_buffer_state 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * examples/testxxLexer.l, src/FlexLexer.h, src/flex.skl, src/main.c: Replaced FLEX_STD macro with std::. The std:: construct exists as of C++98, so we can simply assume it is supported. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/Makefile.am: Generated skel.c explicitly in srcdir. Rewrote the target for skel.c to explicitly mention the srcdir. This should help when building flex from a directory outside the flex tree. Spread the rule out over several lines to enhance readability. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * autogen.sh: Called glibtoolize if libtoolize run fails. On Mac OS X, libtoolize is known as glibtoolize. In cases where libtoolize is not present, then calling glibtoolize when bootstrapping the build system gives more folks a shot at getting flex built from the ground up. 2015-12-02 Mightyjo <mightyjo@gmail.com> * configure.ac: Checked for (g)texi2dvi. Better bison, help2man checks. Added test for presence of (g)texi2dvi program. Gave notice if texi2dvi is unavailable and set TEXI2DVI=: to avoid giving users headaches. Enhanced tests for bison and help2man with notices when the programs aren't found. Set their program variables to use the missing script in build-aux since it's compatible with them. 2015-12-02 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/parse.y, src/scan.l, src/sym.c, src/tables.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Made string copying more standard. copy_string() was a clone of the stdlib's strdup(). For safety, simplicity, and speed, we should use that instead. We introduce xstrdup() which wraps strdup() in a failure upon memory allocation errors. 2015-11-30 Serguey Parkhomovsky <sergueyparkhomovsky@gmail.com> * src/scan.l: Error on unbalanced parentheses in rules section. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Cleaned up BUILT_SOURCES list. Removed reference to skel.c as a built source since other make rules cover this case. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Sorted file names in flex_SOURCES 2015-11-27 Mightyjo <mightyjo@gmail.com> * src/ecs.c, src/flexdef.h, src/main.c, src/misc.c, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Replaced CHAR macro with unsigned char type. Thanks to Michael McConville for pointing out that the old Char macro causes problems with static analysis. The macro has been removed and replaced with 'unsigned char' throughout the flex sources. The macro is not needed at best and was confusing at worst. It was not used in any of the example files nor was it mentioned in the manual at all. 2015-11-21 Will Estes <westes575@gmail.com> * configure.ac: updated syntax of AC_INIT call as per autoupdate 2015-11-21 Will Estes <westes575@gmail.com> * tests/Makefile.am: removed extra call to a _CPPFLAGS variable 2015-05-14 Stefan Reinauer <stefan.reinauer@coreboot.org> * src/buf.c, src/ccl.c, src/dfa.c, src/ecs.c, src/gen.c, src/main.c, src/misc.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Switch function definitions from mixed K&R to consistent ANSI C. flex was using K&R function definitions for some functions and ANSI C style in others, sometimes even in the same file. Change the code to consistently use ANSI C. Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> 2015-11-16 Mightyjo <mightyjo@gmail.com> * tests/Makefile.am: Used in-tree header file for c++ tests.
2017-01-02 19:26:30 +03:00
printf("Testing: test_scan_buffer(%s): ",INPUT_STRING_1); fflush(stdout);
2016-01-09 18:43:18 +03:00
len = strlen(INPUT_STRING_1) + 2;
2016-12-30 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS for 2.6.3 release 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: New configure option '--disable-bootstrap'. If configure is run with '--disable-bootstrap', then stage1flex won't be built and stage1scan.c will be generated by sed'ing scan.c. This option is intended to workaround bootstrap bugs rather than to fix the bootstrapping issues which are proving subtler and harder to fix than anyone would like. 2016-11-26 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: "make clean" deletes stage1scan.c, stage1flex 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: allow building libfl even with --disable-libfl. For various reasons, we may wish to build libfl explicitly even when configure has been run with the --disable-libfl option. This is possible, now, via 'make -C src libfl.la'. 2016-12-19 Alexis La Goutte <alexis.lagoutte@gmail.com> * src/flex.skl: scanner: remove trailing whitespace in skeleton 2016-12-01 Demi Obenour <demiobenour@gmail.com> * src/buf.c, src/main.c, src/parse.y: scanner: Disallow, overquote '[' and ']' in prefix 2016-12-29 Samuel Thibault <samuel.thibault@ens-lyon.org> * src/main.c: scanner: allocate correct buffer size for m4 path. Flex did not check the length of the m4 path which could lead to a buffer overflow in some cases. Additionally, not all platforms believe in PATH_MAX, so stop relying on it. Fixes #138 2016-11-24 Will Estes <westes575@gmail.com> * NEWS: doc: note no more libcompat in NEWS 2016-11-24 Will Estes <westes575@gmail.com> * lib/Makefile.am: build: explain empty lib/Makefile.am 2016-11-20 Explorer09 <explorer09@gmail.com> * configure.ac: build: warn about cross compiling with *alloc 2016-11-19 Explorer09 <explorer09@gmail.com> * configure.ac, lib/Makefile.am, lib/lib.c, src/Makefile.am: build: Link $(LIBOBJS) from src/ dir, remove libcompat.la. The libcompat.la library was small and less friendly to bootstrapping and cross compilation. Now, we will simply link individual object files as needed, which is simpler. 2016-11-16 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: Let stage1flex respect LFLAGS 2016-11-14 Will Estes <westes575@gmail.com> * NEWS: doc: describe --disable-libfl in NEWS 2016-10-31 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: Add --disable-libfl configure option. Disabling libfl is useful when building flex for a cross-toolchain. Fixes: GH-99 2016-11-09 Demi Obenour <demiobenour@gmail.com> * src/flex.skl, tests/array_r.l: fix backwards incompatible changes in 2.6.2. This patch addscompatibility `#defines` for all macros affected by `%prefix`. Fixes #113. 2016-11-08 Will Estes <westes575@gmail.com> * tests/.gitignore: git: ignore quote_in_comment artifacts 2016-11-08 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/Makefile.am, tests/quote_in_comment.l, tests/quote_in_comment.txt: Fixes a major bug in Flex's own lexing of literals. My changes caused Flex to mishandle string and character literals in line comments. This commit fixes them. Fixes #113. 2016-11-06 Thomas Klausner <wiz@NetBSD.org> * configure.ac: Fix unportable test(1) operator. "==" is only supported by bash, "=" is the standard comparison operator. 2016-11-02 Demi Obenour <demiobenour@gmail.com> * tests/quotes.l: Add more escaping tests 2016-11-01 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix another escaping bug in non-indented verbatim section 2 code. I also did some reformatting. 2016-10-28 Alastair Hughes <hobbitalastair@gmail.com> * configure.ac: build: fix false negatives for help2man and texi2dvi HELP2MAN and TEXI2DVI (or the corresponding ac_prog variables) will never be zero length as they fall back to the missing script; check for the fall back and warn on that instead of always warning. 2016-10-28 Explorer09 <explorer09@gmail.com> * doc/Makefile.am: doc: Don't delete flex.1 during "make distclean". flex.1 is pre-generated in release tarball. If we delete it, the next "configure and make" on the source directory will then require help2man unnecessarily. 2016-10-27 Alastair Hughes <hobbitalastair@gmail.com> * NEWS, doc/Makefile.am: Only regenerate the man page when required. Make the flex binary an order-only prerequisite, and add back the prerequisites from before 7cfb440. This prevents rebuilding the man page whenever the flex binary is rebuilt, which causes problems if help2man is not installed and will never work when cross compiling. Fixes #108. 2016-10-26 Will Estes <westes575@gmail.com> * NEWS, src/Makefile.am: build: no longer build PIC version of libfl. The PIC version of libfl was not being built correctly. From the lack of bug reports around this problem, we conclude that the PIC version of libfl is not used and so we drop it from the build build targets for flex. 2016-10-25 Explorer09 <explorer09@gmail.com> * README.md: doc: README.md formatting fixes * Wrap everything in the raw document in 72 char per line limit. * Proper casing for terms "Git" and "GitHub" (don't try to look lazy). * Add unordered list marks when needed. * Say `configure && make && make install` and quoted for fixed-width font. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> 2016-10-25 Will Estes <westes575@gmail.com> * NEWS, configure.ac: build: version 2.6.3 begins 2016-10-24 Will Estes <westes575@gmail.com> * NEWS: doc: mark 2.6.2 release date 2016-10-24 Will Estes <westes575@gmail.com> * .gitignore, NEWS, configure.ac: build: switch xz to lzip 2016-10-20 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/quotes.l: Fix M4 quotation in section 2 prologue and refactor duplicated code 2016-10-21 Alex Kennedy <alexzanderkennedy@gmail.com> * doc/flex.texi: Update flex.texi: Removed repedative wording "Flex used to" was written twice at the beginning of Chapter 9, paragraph 2. 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/dfa.c, src/gen.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, tests/bison_yylval_scanner.l, tests/include_by_push.direct.l: Improved M4 quotation This fixes M4 quotation of certain strings beginning with `yy` (in section 3 of the input file only) and character literals. The new quotation method is also less brittle and faster. Tests that relied on the old behavior were fixed. Also, `yyconst` is no longer defined; use `const` (which it unconditionally was defined to) instead. 2016-10-19 Will Estes <westes575@gmail.com> * Makefile.am, configure.ac: build: for automake, flex is foreign 2016-10-19 Will Estes <westes575@gmail.com> * README, README.md: doc: mv README to README.md 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: touch up README 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: README no longer mentions sourceforge 2016-10-06 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS with more post-2.6.1 additions 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/options.c, src/options.h, src/scan.l, src/yylex.c, tests/Makefile.am, tests/alloc_extra.l, tests/array_r.l, tests/basic_r.l, tests/c_cxx_nr.lll, tests/c_cxx_r.lll, tests/debug_r.l, tests/include_by_reentrant.direct.l, tests/lineno_r.l, tests/mem_nr.l, tests/mem_r.l, tests/posix.l, tests/posixly_correct.l, tests/pthread.l, tests/quotes.l, tests/reject.l4, tests/rescan_nr.direct.l, tests/rescan_r.direct.l, tests/string_nr.l, tests/string_r.l: Fix M4 quoting of section 3. This fixes M4 quoting of section 3 of the input file, including escape sequences and character constants. Tests were added to verify the behavior in section 3 with respect to quoting. Both escaping of quotes and quoting of potential macro-start characters are tested. Existing tests were also fixed to account for the new -- and now correct -- behavior. Many tests relied on the old behavior of expanding M4 macros in section 3. They needed to be updated for the new behavior. 2016-10-03 Mightyjo <mightyjo@gmail.com> * src/flex.skl, tests/.gitignore, tests/Makefile.am, tests/cxx_restart.ll, tests/cxx_restart.txt: Fix yyrestart(NULL) SEGV. 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/scan.l: scanner: M4 quoting fixes 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am: Support `make indent` for out of source builds 2016-09-24 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am, src/mkskel.sh: Simplify some shell code 2016-09-23 Demi Obenour <demiobenour@gmail.com> * doc/flex.texi, src/flex.skl, src/flexdef.h, src/main.c, src/options.c, src/options.h, src/scan.l, tests/.gitignore, tests/Makefile.am, tests/noansi_nr.l, tests/noansi_nr.txt, tests/noansi_r.l, tests/noansi_r.txt: no longer generate K&R C scanners 2016-09-04 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix escaping of `[[` and `]]` in strings Previously, `[[` and `]]` were not escaped in strings, which led to bad interactions with m4. Also, don't break strings on newline, as GCC et al support whitespace between a backslash and the subsequent newline. 2016-06-20 Translation Project <coordinator@translationproject.org> * NEWS, po/sv.po: new sv translation 2016-05-23 Demetri Obenour <demiobenour@gmail.com> * src/misc.c: Delete action_m4_define from misc.c This function was not used and always triggered a fatal error when run. 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am, tests/testwrapper-direct.sh: test: run direct tests from srcdir 2016-01-11 Egor Pugin <egor.pugin@gmail.com> * tests/include_by_buffer.direct.l, tests/include_by_push.direct.l, tests/include_by_reentrant.direct.l: Exited with error code on some conditions in include tests 2016-05-20 Will Estes <westes575@gmail.com> * tests/testwrapper.sh: test: drop .exe when making input file names 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am: test: removed dependencies for include tests 2016-04-28 Tobias Klauser <tklauser@distanz.ch> * src/scanflags.c: Avoid realloc on every call of sf_push() Currently, every call to sf_push() realloc()'s _sf_stack, even if the maximum size _sf_max wasn't changed. As the indentation beneath the "if" clause already indicates, the realloc() should only be executed if _sf_max was increased. Found by compiling flex with the -Wmisleading-indentation flags of gcc, which leads to the following warning: scanflags.c: In function ‘sf_push’: scanflags.c:42:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (_sf_top_ix + 1 >= _sf_max) ^~ scanflags.c:44:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ _sf_stk = realloc(_sf_stk, sizeof(scanflags_t) * _sf_max); ^~~~~~~ 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: prettified command to build man page 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: added man page to DISTCLEANFILES 2016-03-31 Will Estes <westes575@gmail.com> * BUGS, TODO: remove unused TODO, BUGS files 2016-03-31 Will Estes <westes575@gmail.com> * to.do/README, to.do/Wilhelms.todo, to.do/Wish-List, to.do/flex.rmail, to.do/streams.mail, to.do/unicode/FlexLexer.h, to.do/unicode/ccl.c, to.do/unicode/changes.txt, to.do/unicode/ecs.c, to.do/unicode/flex.1, to.do/unicode/flex.skl, to.do/unicode/flexdef.h, to.do/unicode/gen.c, to.do/unicode/main.c, to.do/unicode/misc.c, to.do/unicode/scan.l, to.do/unicode/tblcmp.c: removed to.do/ directory 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: removed flex.skl from POTFILES.in file list 2016-03-31 rlar <rlar> * src/Makefile.am: fix skel.c dependency (missing tables_shared.c) and polish build rule Also remove references to srcdir since skel.c is no longer mentioned in po/POTFILES.in. 2016-03-31 rlar <rlar> * doc/Makefile.am: fix flex.1 dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 && \ make dist failed with: > help2man: can't get `--help' info from ../../flex/src/flex Note: There is no dependency except for the flex binary. 2016-03-31 rlar <rlar> * src/Makefile.am: fix stage1scan.c and stage1scan.l dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 failed with: > ../src/stage1flex -o stage1scan.c stage1scan.l > stage1flex: can't open stage1scan.l Note: stage1scan.c is not necessairy in the "make dist" generated tar.gz file. stage1flex will be build from scan.c (which is distributed), and this will then generate stage1scan.c from scan.l 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: list src/flex.skl in po/POTFILES.in 2016-03-29 rlar <rlar> * src/gen.c: warning in generated code, with -Ca warning: conversion to 'yy_state_type' from 'flex_uint32_t' may change the sign of the result [-Wsign-conversion] 2016-03-29 rlar <rlar> * tests/Makefile.am: suppress `WARNINGFLAGS' for the almost obsolete `noansi' test cases 2016-03-29 rlar <rlar> * configure.ac, src/Makefile.am, tests/Makefile.am: configure option `--enable-warnings' and `WARNINGFLAGS' `WARNINGFLAGS' can be passed when invoking `configure' and when invoking `make' if configure switch `--enable-warnings' was given then default to something useful if we have `GCC' `WARNINGFLAGS' is not used when compiling `stage1flex' to avoid unnecessary clutter 2016-03-31 Tobias Klauser <tklauser@distanz.ch> * src/main.c: Fix potential buffer overflow in strncat() When using clang/llvm 3.8 to compile flex, the following warning is emitted: main.c:378:27: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size] strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ main.c:378:27: note: change the argument to be the free space in the destination buffer minus the terminating null byte strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ sizeof(m4_path) - strlen(m4_path) - 1Fix it up by using the solution proposed by the warning message. 2016-03-29 Robert.Larice Robert Larice <Robert.Larice@t-online.de> * src/Makefile.am: build: simplified dependency tracking so parallel make runs succeed 2016-03-20 rlar <rlar> * src/flex.skl, src/gen.c, src/main.c: avoid warning in generated code, with -Cf warning: conversion to 'unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-18 Will Estes <westes575@gmail.com> * NEWS, configure.ac: mention v2.6.2; summarize changes since 2.6.1 2016-03-18 Will Estes <westes575@gmail.com> * doc/flex.texi: doc: corrected example in manual, gh#67 2016-03-16 rlar <rlar> * tests/string_nr.l, tests/string_r.l, tests/yyextra.l: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * tests/mem_nr.l, tests/mem_r.l, tests/pthread.l: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * src/flex.skl: warning: conversion to 'flex_uint32_t' from 'long unsigned int' may alter its value [-Wconversion] struct yytbl_reader, member bread is of type flex_uint32_t 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/bison_nr_main.c, tests/bison_nr_parser.y, tests/bison_yylloc_parser.y: warning: redundant redeclaration of '...' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/bison_nr_parser.y, tests/bison_yylloc_parser.y, tests/bison_yylval_parser.y, tests/pthread.l: warning: no previous prototype for '...' [-Wmissing-prototypes] 2016-03-16 rlar <rlar> * tests/multiple_scanners_r_main.c: warning: unused variable 'fp' [-Wunused-variable] 2016-03-16 rlar <rlar> * tests/pthread.l: main(), warning: redundant redeclaration of 'main' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/include_by_reentrant.direct.l, tests/lineno_nr.l, tests/lineno_r.l, tests/lineno_trailing.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/array_nr.l, tests/array_r.l, tests/basic_nr.l, tests/basic_r.l, tests/ccl.l, tests/debug_nr.l, tests/debug_r.l, tests/extended.l, tests/mem_nr.l, tests/mem_r.l, tests/noansi_r.l, tests/posix.l, tests/posixly_correct.l, tests/prefix_nr.l, tests/prefix_r.l, tests/quotes.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-01 rlar <rlar> * src/ecs.c, src/tblcmp.c: Fix two more casts 2016-03-14 Bastian Köcher <git@kchr.de> * src/gen.c: Fixes yyl compare with unsigned warning 2016-03-13 Robert Larice <Robert.Larice@t-online.de> * configure.ac: Suppress portability warnings in Makefile generation 2016-02-27 rlar <rlar> * src/flex.skl: generated code, in yyensure_buffer_stack(), change type of local `num_to_alloc' which is exclusively used in yy_size_t context 2016-03-01 rlar <rlar> * src/flex.skl: generated code, in yy_get_next_buffer(), change type of local `number_to_move' suits better, because `yy_n_chars' and `yy_buf_size' are of type `int' 2016-02-27 rlar <rlar> * src/flex.skl: generated code, `_yybytes_len' is of type `int', fix code accordingly 2016-02-28 rlar <rlar> * src/gen.c: generated code, `max_size' seems to be of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, here `new_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `yy_buf_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `offset' is of type `int' 2016-02-28 rlar <rlar> * src/gen.c: generated code, `yy_more_len' is of type `int' 2016-02-28 rlar <rlar> * src/scan.l: scan.l, rewrite two loops to avoid unneccesairy casting 2016-03-01 rlar <rlar> * src/regex.c, src/tables.c: improve readability 2016-02-28 rlar <rlar> * src/tblcmp.c: another cast in tblcmp.c to avoid warning 2016-02-28 rlar <rlar> * src/buf.c: casts in buf_append() to get rid of warnings 2016-02-28 rlar <rlar> * src/dfa.c, src/gen.c: cast to suite type of flex_uint32_t td_lolen 2016-02-28 rlar <rlar> * src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanopt.c, src/tables_shared.c: cast to get rid of warnings 2016-03-01 rlar <rlar> * src/buf.c, src/main.c: cast and fix usage of log10(), ceil to prevent buffer overflow 2016-03-01 rlar <rlar> * src/tables.c: tables.c, sprinkle casts to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_data_compress(), change type of local newsz to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c, src/tables.h: change type of struct yytbl_writer.total_written to get rid of warnings 2016-02-28 rlar <rlar> * src/tables.c: change argument type of yytbl_writen() to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_write8/16/32(), change type of local variables to get rid of warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/misc.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: change return type and rename int htoi()/otoi() --> unsigned int htoui()/otoui() 2016-03-01 Will Estes <westes575@gmail.com> * NEWS: Mention 2.6.1 release date 2016-02-28 rlar <rlar> * src/gen.c: avoid warning, add (int) cast to the read() return value For similiarity with the fread() case. 2016-02-28 rlar <rlar> * src/scan.l: avoid warning, POSIX says yyless() has an `int' argument 2016-02-29 rlar <rlar> * src/filter.c: use type size_t in filter_tee_header() to avoid warnings 2016-02-29 rlar <rlar> * src/filter.c, src/misc.c, src/scanopt.c, src/tables.c: add (size_t) casts to malloc invocations to prevent warnings 2016-02-29 rlar <rlar> * src/buf.c, src/misc.c, src/scan.l, src/scanopt.c, src/tables.c: add (int) casts to some strlen() invocations to prevent warnings 2016-02-29 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndlookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndinstal(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: cclinstal() and ccllookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/gen.c: warning: redundant redeclaration of ‘gen_next_state’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/gen.c: warning: no previous prototype for ‘mkecstbl’ [-Wmissing-prototypes] 2016-02-28 rlar <rlar> * src/main.c: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yywrap’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yylval’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yyin’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h, src/main.c: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: unification, rename some more rename these too for improved similiarity: OPTION_OP OPT_HEADER OPT_EXTRA_TYPE OPT_TABLES 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: fix name clash, OPT_OUTFILE from parse.y and from options.h these collide: OPT_OUTFILE OPT_PREFIX OPT_YYCLASS rename them TOK_... in the parser 2016-02-28 Will Estes <westes575@gmail.com> * lib/reallocarray.c: Prototyped reallocarray implementation 2016-02-28 Will Estes <westes575@gmail.com> * src/scanopt.c: Removed custom strcasecmp() function 2016-02-28 rlar <rlar> * src/flex.skl: fwrite wants a size_t, yyleng is int per posix 2016-02-28 rlar <rlar> * src/scanopt.c: Remove some unneeded casts 2016-02-28 rlar <rlar> * src/flexdef.h: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion] 2016-02-27 rlar <rlar> * src/dfa.c, src/parse.y: dfa.c:157:24: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] most certainly safe cast 2016-02-27 rlar <rlar> * src/ccl.c: ccl.c:86:19: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion] ch seems to have been checked for proper range some lines above 2016-02-27 rlar <rlar> * tests/bison_nr_parser.y: warning: deprecated directive, use '%pure-parser' [-Wdeprecated] 2016-02-27 rlar <rlar> * lib/lib.c: warning: no previous prototype for 'do_nothing' [-Wmissing-prototypes] 2016-02-27 rlar <rlar> * src/libmain.c: included stdlib.h header 2016-02-27 Will Estes <westes575@gmail.com> * NEWS: Described more post v2.6.0 changes 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: build: Removed bzip2 distribiution archive 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: removed obsolete program check 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: Made some program checks more robust 2016-02-27 rlar <rlar> * src/flex.skl: Remove unneeded cast to int 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fixed incorrect integer type 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fix more integer types, resolves sf 184, 187 2016-02-26 Robert Larice <Robert.Larice@t-online.de> * src/flex.skl, src/gen.c: Removed some type conversion warnings 2016-02-26 Will Estes <westes575@gmail.com> * src/flex.skl: Changed another buffer size to int; resolves gh#61 2016-02-24 Will Estes <westes575@gmail.com> * src/flex.skl: Changed type of yy_n_chars to int; gh#53, sf#160. The variable yy_n_chars had been of type yy_size_t which is incorrect given its use in read(). While it might be adviseable to look at defining a yy_ssize_t, there might be some issues doing this and so, for now, at least, we'll punt back to int. 2016-02-24 Will Estes <westes575@gmail.com> * src/buf.c: Fixed size of bufferallocation, resolved gh#54. The value of n_alloc was a count, not a size. Multiplying the value by the element size was incorrect. That multiplication was already being done and having it done twice was incorrect. 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/scan.l: Allow '%option noline' in flex input file, resolves gh#56. Allow specifying '%option noline' in the input file, leading to the same effect as calling flex with the command line option --noline. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/buf.c, src/main.c: Emit no #line directives if gen_line_dirs is false, resolves igh#55. There are two instances in the code which will print a #line directive to the resulting lexer, regardless of the value of gen_line_dirs. Fix them, so they also respect gen_line_dirs. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-16 Tobias Klauser <tklauser@distanz.ch> * lib/lib.c, src/gen.c, src/misc.c, src/scan.l: Converted K&R style function definitions to ANSI C style Consistently make use of the ANSI C function definition style instead of the K&R style. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Used NULL constant instead of plain integer for NULL pointer. The sparse static checker warns about using plain integer 0 as NULL pointers in the generated lexer code. Fix this by using NULL consistently for pointers. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Marked declaration and definition of yy_fatal_error as noreturn. Only the declaration of yy_fatal_error is marked with __attribute__((__noreturn__)) in case GCC >= 3 is used, but not the definition. This leads to the sparse static checker to complain about function declaration mismatch. Fix it by defining a macro yynoreturn and using it for both the declaration and the definition of yy_fatal_error. 2016-01-27 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Fixed declaration mismatch in yy_fatal_error. The prototype declares yy_fatal_error parameter as "const char msg[]" while the definition uses "const char* msg" (introduced by commit e9d5fc713f61b) which causes the sparse static checkers to produce an error. Fix this by adjusting the definition to use "const char* msg" as well. Also change the C++ version accordingly so it matches the declaration in FlexLexer.hpp. 2016-01-23 Will Estes <westes575@gmail.com> * CODE_OF_CONDUCT.md: flex is for flex #NCoC 2016-01-18 Will Estes <westes575@gmail.com> * doc/flex.texi: Referred to github for issue tracking, no longer sf 2016-01-10 Egor Pugin <egor.pugin@gmail.com> * tests/reject.l4, tests/tableopts.l4: Opened files in binary mode explicitly 2016-01-08 OBATA Akio <obache@NetBSD.org> * src/Makefile.am: Linked flex binary against libintl, not libfl. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> 2016-01-08 Michael van Elst <mlelstv@NetBSD.org> * src/filter.c: Improved pipe-stdin hack behavior; resolves sf#198. Signed-off-by: Thomas <Klausner wiz@NetBSD.org> 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac, src/flexdef.h: Removed no longer needed header checks 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac: Checked for reallocarray() with AC_REPLACE_FUNCS 2015-12-27 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: include libgen.h from flexdef.h, not main.c 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Replace basename2() with basename(3). Given the following program: \#include <libgen.h> \#include <stdio.h> /* extracts basename from path, optionally stripping the extension "\.*" * (same concept as /bin/sh `basename`, but different handling of extension). */ static char *basename2 (char *path) { char *b; for (b = path; *path; path++) if (*path == '/') b = path + 1; return b; } static void basename_compare(char *path) { printf("basename: %s\n", basename(path)); printf("basename2: %s\n\n", basename2(path)); } int main (int argc, char *argv[]) { // From http://pubs.opengroup.org/onlinepubs/9699919799/ // ``Sample Input and Output Strings'' basename_compare("/usr/lib"); basename_compare("/usr/"); basename_compare("/"); basename_compare("///"); basename_compare("//usr//lib//"); return 0; } ... and the program's output: basename: lib basename2: lib basename: usr basename2: basename: / basename2: basename: / basename2: basename: lib basename2: ... we can see that basename2() behaves the same as basename(3) in the average use case, but messes up pretty severely in others. Besides that, basename(3) is mandated by POSIX so should be present on modern Unix-like systems, so we shouldn't define it ourselves. Some notes: - it doesn't appear to be mentioned in POSIX, but OpenBSD's basename(3) returns NULL if the returned path componenet is > PATH_MAX, so add a check for that - basename(3) shouldn't return an empty string, so remove the program_name[0] != '\0' check 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Simplify basename2(). It's only call site does not activate the `strip_ext` code path, so the function can be simplified a lot. While here, remove a double assignment. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flex.skl, src/misc.c: Cleaned up __STDC__ #ifdefs. Assuming a compiler conforming to the ISO C standard is used, i.e., __STDC__ is defined to 1, YY_USE_CONST is always defined and can be eliminated. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flexdef.h, src/main.c, src/scanopt.c, src/scanopt.h, src/sym.c: Remove remaining use of PROTO 2015-12-21 Serguey Parkhomovsky <xindigo@gmail.com> * src/buf.c: buf.c: use snprintf 2015-12-19 Will Estes <westes575@gmail.com> * configure.ac: build: reformatted AC_CHECK_FUNCS for readability 2015-12-17 Will Estes <westes575@gmail.com> * src/scanopt.c: correct function prototype 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c, src/scanopt.c, src/sym.c, src/tblcmp.c: Remove more instances of PROTO 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c: Removed prototype for main(). It's not called anywhere else so the prototype is not needed. See the C99 standard [1], section 5.1.2.2.1 for more info. [1]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/dfa.c, src/gen.c, src/nfa.c, to.do/unicode/main.c, to.do/unicode/tblcmp.c: Removed more instances of PROTO, ansifying. 2015-12-13 Will Estes <westes575@gmail.com> * README: Noted github for issue tracking and pull requests 2015-12-13 Michael McConville <mmcco@mykolab.com> * README: Reformatted README; removed sf bug tracking link. 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/gen.c, to.do/unicode/gen.c: Removed macros for indentation level. Just increment or decrement the indentation counter. That's less to remember and makes the code more readable. w# Please enter the commit message for your changes. Lines starting 2015-12-12 Mike Frysinger <vapier@gentoo.org> * tests/Makefile.am, tests/testwrapper.sh: tests: fixed paths to input files. The current test wrapper works only when the inputs are specified using relative paths. If they're specified with absolute paths, the driver fails to detect the inputs because it always prepends the input dir name which itself is a relative path: $ cd tests $ ./testwrapper.sh -d . -i $PWD/reject.txt -t ./reject_ver.table <fails to open inputs> This normally doesn't show up because people run `./configure` or, for out of tree builds, `../configure`. But if you happen to run configure with an absolute path, then automake tends to generate absolute paths as well leading to test failures. Fix all of this by dropping the implicit input directory prepending. - INPUT_NAME is often a list of files, not just a single one - the input directory is used to find the testname tables which are usually generated, so it's impossible to use files from both source and build directories - most of the time, the full/correct path is already specified 2015-12-12 Mike Frysinger <vapier@gentoo.org> * configure.ac: configure: fixed realloc test. The [] characters are used for quoting in m4, so the attempt to use them in place of `test` fails yielding the warning at build time: .../flex/configure: line 20222: no: command not found 2015-12-12 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Started removal of PROTO macro. The PROTO macro is no longer needed. Additionally, its usage is inconsistent, so we began removing it. 2015-12-12 Michael Reed <m.reed@mykolab.com> * Makefile.am, src/main.c: Removed SHORT_FILE_NAMES preprocessor symbol. As a relic of MS-DOS, we don't need this. It's never defined; see 13b5b214f53d1c3354a7ab910bd160c126df1331. Removed additional MSDOS ifdef. 2015-12-11 Michael McConville <mmcco@mykolab.com> * configure.ac, lib/reallocarray.c, src/flexdef.h: Added new function reallocarray. This is taken from OpenSSH Portable, which in turn takes it from OpenBSD. reallocarray wraps the stdlib's realloc function. It takes two size arguments and checks for overflow, like calloc, but doesn't zero the memory. Therefore, it allows us to do overflow-safe array reallocations and overflow-safe unzeroed array allocations, which the stdlib allocation functions don't. We have a bunch of specific array allocation macros, none of which check for overflow. reallocarray should be able to replace them. 2015-12-11 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Removed MS-DOS, VMS macros. Given the age of the MS-DOS and VMS platforms, it's likely that no one is building flex on them any more. Additionally, the preferred approach is to test for particular platform features rather than to test for particular platforms. 2015-12-12 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: Made search for m4 more explicit. 2015-12-12 Will Estes <westes575@gmail.com> * src/flex.skl: Returned 0 from yywrap() instead of EOF 2015-12-11 Will Estes <westes575@gmail.com> * src/libmain.c: Changed end of main() in libmain to exit(0) 2015-12-11 Will Estes <westes575@gmail.com> * NEWS, configure.ac: Mentioned v2.6.1; documented some changes since v2.6.0 2015-12-11 Will Estes <westes575@gmail.com> * README: Updated build documentation; finished sf#155. Removed version numbers for build tools. Noted that version requirements for build tools will be noted in configure.ac. Expanded documentation of building texinfo based docs. 2015-12-11 Will Estes <westes575@gmail.com> * doc/Makefile.am: Removed flex.pdf from distribution; partially fixed sf#155 2015-12-11 Will Estes <westes575@gmail.com> * src/flex.skl: Commented in C style in skeleton; fixed sf#195 2015-12-10 Will Estes <westes575@gmail.com> * .gitignore: Ignored autoscan files 2015-12-09 Will Estes <westes575@gmail.com> * configure.ac: Checked for ranlib and strdup() at configure time 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/tblcmp.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/tblcmp.c: Replace zero_out() with stdlib's memset. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flex.skl: Removed memory allocation casts. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed alloca() configuration. Since alloca() is dangerous, depricated, we remove it. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed implementation of isascii(). POSIX defines isascii(), so it's likely present on anything weactually build flex on these days. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/main.c, src/scanopt.c, src/tables.c: Removed NULL-checks before free() 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/flexdef.h, src/gen.c, src/scan.l, to.do/unicode/flexdef.h, to.do/unicode/scan.l: Removed flex_free()i, corrected buf_destroy logic. As with flex_alloc(), replace with direct calls to free(). The function buf_destroy is now null safe and the logic was corrected to free() correctly. 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/filter.c, src/flexdef.h, src/misc.c, src/scan.l, src/scanflags.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_realloc(). As with flex_alloc(), replace calls to flex_realloc(), which was just a wrapper around realloc(). 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanflags.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_alloc; cleaned up style. The function flex_alloc() was just a wrapper around malloc(). Since this only added unclarity, and the flex_alloc() function is likely a legacy of olden times, remove it in favor of calls to malloc() directly. Style elements cleaned up: * superfluous spacing around parentheses * non-constant initialization in variable declarations * needless casts * almost all uses of assignments as subexpressions 2015-12-07 Michael McConville <mmcconville@mykolab.com> * src/dfa.c, src/flexdef.h, src/gen.c, src/main.c, src/scan.l, src/scanopt.c, tests/bison_nr_scanner.l, tests/bison_yylloc_scanner.l, tests/bison_yylval_scanner.l, tests/mem_nr.l, tests/mem_r.l, tests/pthread.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l, to.do/unicode/scan.l: Remove allocation casts 2015-12-07 Will Estes <westes575@gmail.com> * src/.gitignore, src/Makefile.am: Built flex with itself. Changes in scan.l need to be built into flex with the same version of flex in some cases. Since this build requirement is minimal, we simply bootstrap flex unconditionally. We intentionally exclude from version control the bootstrap artifacts as the extra copy of the lexer, the intermediate scanner and the bootstrap executable are not of interest. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, to.do/unicode/main.c, to.do/unicode/scan.l: Use NULL rather than (type *) 0. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: Replace copy_unsigned_string() with xstrdup(). Like copy_string(), copy_unsigned_string() is just a clone of the stlib's strdup(). We only use it twice. I'm pretty confident that char signedness is irrelevant in this case. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Cleaned up white space. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Removed struct keyword before yy_buffer_state 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * examples/testxxLexer.l, src/FlexLexer.h, src/flex.skl, src/main.c: Replaced FLEX_STD macro with std::. The std:: construct exists as of C++98, so we can simply assume it is supported. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/Makefile.am: Generated skel.c explicitly in srcdir. Rewrote the target for skel.c to explicitly mention the srcdir. This should help when building flex from a directory outside the flex tree. Spread the rule out over several lines to enhance readability. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * autogen.sh: Called glibtoolize if libtoolize run fails. On Mac OS X, libtoolize is known as glibtoolize. In cases where libtoolize is not present, then calling glibtoolize when bootstrapping the build system gives more folks a shot at getting flex built from the ground up. 2015-12-02 Mightyjo <mightyjo@gmail.com> * configure.ac: Checked for (g)texi2dvi. Better bison, help2man checks. Added test for presence of (g)texi2dvi program. Gave notice if texi2dvi is unavailable and set TEXI2DVI=: to avoid giving users headaches. Enhanced tests for bison and help2man with notices when the programs aren't found. Set their program variables to use the missing script in build-aux since it's compatible with them. 2015-12-02 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/parse.y, src/scan.l, src/sym.c, src/tables.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Made string copying more standard. copy_string() was a clone of the stdlib's strdup(). For safety, simplicity, and speed, we should use that instead. We introduce xstrdup() which wraps strdup() in a failure upon memory allocation errors. 2015-11-30 Serguey Parkhomovsky <sergueyparkhomovsky@gmail.com> * src/scan.l: Error on unbalanced parentheses in rules section. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Cleaned up BUILT_SOURCES list. Removed reference to skel.c as a built source since other make rules cover this case. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Sorted file names in flex_SOURCES 2015-11-27 Mightyjo <mightyjo@gmail.com> * src/ecs.c, src/flexdef.h, src/main.c, src/misc.c, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Replaced CHAR macro with unsigned char type. Thanks to Michael McConville for pointing out that the old Char macro causes problems with static analysis. The macro has been removed and replaced with 'unsigned char' throughout the flex sources. The macro is not needed at best and was confusing at worst. It was not used in any of the example files nor was it mentioned in the manual at all. 2015-11-21 Will Estes <westes575@gmail.com> * configure.ac: updated syntax of AC_INIT call as per autoupdate 2015-11-21 Will Estes <westes575@gmail.com> * tests/Makefile.am: removed extra call to a _CPPFLAGS variable 2015-05-14 Stefan Reinauer <stefan.reinauer@coreboot.org> * src/buf.c, src/ccl.c, src/dfa.c, src/ecs.c, src/gen.c, src/main.c, src/misc.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Switch function definitions from mixed K&R to consistent ANSI C. flex was using K&R function definitions for some functions and ANSI C style in others, sometimes even in the same file. Change the code to consistently use ANSI C. Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> 2015-11-16 Mightyjo <mightyjo@gmail.com> * tests/Makefile.am: Used in-tree header file for c++ tests.
2017-01-02 19:26:30 +03:00
buf = malloc(len);
2016-01-09 18:43:18 +03:00
strcpy( buf, INPUT_STRING_1);
buf[ len -2 ] = 0; /* Flex requires two NUL bytes at end of buffer. */
buf[ len -1 ] =0;
2016-12-30 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS for 2.6.3 release 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: New configure option '--disable-bootstrap'. If configure is run with '--disable-bootstrap', then stage1flex won't be built and stage1scan.c will be generated by sed'ing scan.c. This option is intended to workaround bootstrap bugs rather than to fix the bootstrapping issues which are proving subtler and harder to fix than anyone would like. 2016-11-26 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: "make clean" deletes stage1scan.c, stage1flex 2016-11-26 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: allow building libfl even with --disable-libfl. For various reasons, we may wish to build libfl explicitly even when configure has been run with the --disable-libfl option. This is possible, now, via 'make -C src libfl.la'. 2016-12-19 Alexis La Goutte <alexis.lagoutte@gmail.com> * src/flex.skl: scanner: remove trailing whitespace in skeleton 2016-12-01 Demi Obenour <demiobenour@gmail.com> * src/buf.c, src/main.c, src/parse.y: scanner: Disallow, overquote '[' and ']' in prefix 2016-12-29 Samuel Thibault <samuel.thibault@ens-lyon.org> * src/main.c: scanner: allocate correct buffer size for m4 path. Flex did not check the length of the m4 path which could lead to a buffer overflow in some cases. Additionally, not all platforms believe in PATH_MAX, so stop relying on it. Fixes #138 2016-11-24 Will Estes <westes575@gmail.com> * NEWS: doc: note no more libcompat in NEWS 2016-11-24 Will Estes <westes575@gmail.com> * lib/Makefile.am: build: explain empty lib/Makefile.am 2016-11-20 Explorer09 <explorer09@gmail.com> * configure.ac: build: warn about cross compiling with *alloc 2016-11-19 Explorer09 <explorer09@gmail.com> * configure.ac, lib/Makefile.am, lib/lib.c, src/Makefile.am: build: Link $(LIBOBJS) from src/ dir, remove libcompat.la. The libcompat.la library was small and less friendly to bootstrapping and cross compilation. Now, we will simply link individual object files as needed, which is simpler. 2016-11-16 Explorer09 <explorer09@gmail.com> * src/Makefile.am: build: Let stage1flex respect LFLAGS 2016-11-14 Will Estes <westes575@gmail.com> * NEWS: doc: describe --disable-libfl in NEWS 2016-10-31 Explorer09 <explorer09@gmail.com> * configure.ac, src/Makefile.am: build: Add --disable-libfl configure option. Disabling libfl is useful when building flex for a cross-toolchain. Fixes: GH-99 2016-11-09 Demi Obenour <demiobenour@gmail.com> * src/flex.skl, tests/array_r.l: fix backwards incompatible changes in 2.6.2. This patch addscompatibility `#defines` for all macros affected by `%prefix`. Fixes #113. 2016-11-08 Will Estes <westes575@gmail.com> * tests/.gitignore: git: ignore quote_in_comment artifacts 2016-11-08 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/Makefile.am, tests/quote_in_comment.l, tests/quote_in_comment.txt: Fixes a major bug in Flex's own lexing of literals. My changes caused Flex to mishandle string and character literals in line comments. This commit fixes them. Fixes #113. 2016-11-06 Thomas Klausner <wiz@NetBSD.org> * configure.ac: Fix unportable test(1) operator. "==" is only supported by bash, "=" is the standard comparison operator. 2016-11-02 Demi Obenour <demiobenour@gmail.com> * tests/quotes.l: Add more escaping tests 2016-11-01 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix another escaping bug in non-indented verbatim section 2 code. I also did some reformatting. 2016-10-28 Alastair Hughes <hobbitalastair@gmail.com> * configure.ac: build: fix false negatives for help2man and texi2dvi HELP2MAN and TEXI2DVI (or the corresponding ac_prog variables) will never be zero length as they fall back to the missing script; check for the fall back and warn on that instead of always warning. 2016-10-28 Explorer09 <explorer09@gmail.com> * doc/Makefile.am: doc: Don't delete flex.1 during "make distclean". flex.1 is pre-generated in release tarball. If we delete it, the next "configure and make" on the source directory will then require help2man unnecessarily. 2016-10-27 Alastair Hughes <hobbitalastair@gmail.com> * NEWS, doc/Makefile.am: Only regenerate the man page when required. Make the flex binary an order-only prerequisite, and add back the prerequisites from before 7cfb440. This prevents rebuilding the man page whenever the flex binary is rebuilt, which causes problems if help2man is not installed and will never work when cross compiling. Fixes #108. 2016-10-26 Will Estes <westes575@gmail.com> * NEWS, src/Makefile.am: build: no longer build PIC version of libfl. The PIC version of libfl was not being built correctly. From the lack of bug reports around this problem, we conclude that the PIC version of libfl is not used and so we drop it from the build build targets for flex. 2016-10-25 Explorer09 <explorer09@gmail.com> * README.md: doc: README.md formatting fixes * Wrap everything in the raw document in 72 char per line limit. * Proper casing for terms "Git" and "GitHub" (don't try to look lazy). * Add unordered list marks when needed. * Say `configure && make && make install` and quoted for fixed-width font. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> 2016-10-25 Will Estes <westes575@gmail.com> * NEWS, configure.ac: build: version 2.6.3 begins 2016-10-24 Will Estes <westes575@gmail.com> * NEWS: doc: mark 2.6.2 release date 2016-10-24 Will Estes <westes575@gmail.com> * .gitignore, NEWS, configure.ac: build: switch xz to lzip 2016-10-20 Demi Obenour <demiobenour@gmail.com> * src/scan.l, tests/quotes.l: Fix M4 quotation in section 2 prologue and refactor duplicated code 2016-10-21 Alex Kennedy <alexzanderkennedy@gmail.com> * doc/flex.texi: Update flex.texi: Removed repedative wording "Flex used to" was written twice at the beginning of Chapter 9, paragraph 2. 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/dfa.c, src/gen.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, tests/bison_yylval_scanner.l, tests/include_by_push.direct.l: Improved M4 quotation This fixes M4 quotation of certain strings beginning with `yy` (in section 3 of the input file only) and character literals. The new quotation method is also less brittle and faster. Tests that relied on the old behavior were fixed. Also, `yyconst` is no longer defined; use `const` (which it unconditionally was defined to) instead. 2016-10-19 Will Estes <westes575@gmail.com> * Makefile.am, configure.ac: build: for automake, flex is foreign 2016-10-19 Will Estes <westes575@gmail.com> * README, README.md: doc: mv README to README.md 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: touch up README 2016-10-19 Will Estes <westes575@gmail.com> * README: doc: README no longer mentions sourceforge 2016-10-06 Will Estes <westes575@gmail.com> * NEWS: doc: update NEWS with more post-2.6.1 additions 2016-09-27 Demi Obenour <demiobenour@gmail.com> * src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/options.c, src/options.h, src/scan.l, src/yylex.c, tests/Makefile.am, tests/alloc_extra.l, tests/array_r.l, tests/basic_r.l, tests/c_cxx_nr.lll, tests/c_cxx_r.lll, tests/debug_r.l, tests/include_by_reentrant.direct.l, tests/lineno_r.l, tests/mem_nr.l, tests/mem_r.l, tests/posix.l, tests/posixly_correct.l, tests/pthread.l, tests/quotes.l, tests/reject.l4, tests/rescan_nr.direct.l, tests/rescan_r.direct.l, tests/string_nr.l, tests/string_r.l: Fix M4 quoting of section 3. This fixes M4 quoting of section 3 of the input file, including escape sequences and character constants. Tests were added to verify the behavior in section 3 with respect to quoting. Both escaping of quotes and quoting of potential macro-start characters are tested. Existing tests were also fixed to account for the new -- and now correct -- behavior. Many tests relied on the old behavior of expanding M4 macros in section 3. They needed to be updated for the new behavior. 2016-10-03 Mightyjo <mightyjo@gmail.com> * src/flex.skl, tests/.gitignore, tests/Makefile.am, tests/cxx_restart.ll, tests/cxx_restart.txt: Fix yyrestart(NULL) SEGV. 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/scan.l: scanner: M4 quoting fixes 2016-09-05 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am: Support `make indent` for out of source builds 2016-09-24 Demi Obenour <demiobenour@gmail.com> * src/Makefile.am, src/mkskel.sh: Simplify some shell code 2016-09-23 Demi Obenour <demiobenour@gmail.com> * doc/flex.texi, src/flex.skl, src/flexdef.h, src/main.c, src/options.c, src/options.h, src/scan.l, tests/.gitignore, tests/Makefile.am, tests/noansi_nr.l, tests/noansi_nr.txt, tests/noansi_r.l, tests/noansi_r.txt: no longer generate K&R C scanners 2016-09-04 Demi Obenour <demiobenour@gmail.com> * src/scan.l: Fix escaping of `[[` and `]]` in strings Previously, `[[` and `]]` were not escaped in strings, which led to bad interactions with m4. Also, don't break strings on newline, as GCC et al support whitespace between a backslash and the subsequent newline. 2016-06-20 Translation Project <coordinator@translationproject.org> * NEWS, po/sv.po: new sv translation 2016-05-23 Demetri Obenour <demiobenour@gmail.com> * src/misc.c: Delete action_m4_define from misc.c This function was not used and always triggered a fatal error when run. 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am, tests/testwrapper-direct.sh: test: run direct tests from srcdir 2016-01-11 Egor Pugin <egor.pugin@gmail.com> * tests/include_by_buffer.direct.l, tests/include_by_push.direct.l, tests/include_by_reentrant.direct.l: Exited with error code on some conditions in include tests 2016-05-20 Will Estes <westes575@gmail.com> * tests/testwrapper.sh: test: drop .exe when making input file names 2016-05-20 Will Estes <westes575@gmail.com> * tests/Makefile.am: test: removed dependencies for include tests 2016-04-28 Tobias Klauser <tklauser@distanz.ch> * src/scanflags.c: Avoid realloc on every call of sf_push() Currently, every call to sf_push() realloc()'s _sf_stack, even if the maximum size _sf_max wasn't changed. As the indentation beneath the "if" clause already indicates, the realloc() should only be executed if _sf_max was increased. Found by compiling flex with the -Wmisleading-indentation flags of gcc, which leads to the following warning: scanflags.c: In function ‘sf_push’: scanflags.c:42:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (_sf_top_ix + 1 >= _sf_max) ^~ scanflags.c:44:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ _sf_stk = realloc(_sf_stk, sizeof(scanflags_t) * _sf_max); ^~~~~~~ 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: prettified command to build man page 2016-03-31 Will Estes <westes575@gmail.com> * doc/Makefile.am: build: added man page to DISTCLEANFILES 2016-03-31 Will Estes <westes575@gmail.com> * BUGS, TODO: remove unused TODO, BUGS files 2016-03-31 Will Estes <westes575@gmail.com> * to.do/README, to.do/Wilhelms.todo, to.do/Wish-List, to.do/flex.rmail, to.do/streams.mail, to.do/unicode/FlexLexer.h, to.do/unicode/ccl.c, to.do/unicode/changes.txt, to.do/unicode/ecs.c, to.do/unicode/flex.1, to.do/unicode/flex.skl, to.do/unicode/flexdef.h, to.do/unicode/gen.c, to.do/unicode/main.c, to.do/unicode/misc.c, to.do/unicode/scan.l, to.do/unicode/tblcmp.c: removed to.do/ directory 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: removed flex.skl from POTFILES.in file list 2016-03-31 rlar <rlar> * src/Makefile.am: fix skel.c dependency (missing tables_shared.c) and polish build rule Also remove references to srcdir since skel.c is no longer mentioned in po/POTFILES.in. 2016-03-31 rlar <rlar> * doc/Makefile.am: fix flex.1 dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 && \ make dist failed with: > help2man: can't get `--help' info from ../../flex/src/flex Note: There is no dependency except for the flex binary. 2016-03-31 rlar <rlar> * src/Makefile.am: fix stage1scan.c and stage1scan.l dependency git clean -fdx && ./autogen.sh && \ mkdir -p ../build && cd ../build && ../flex/configure && make -j10 failed with: > ../src/stage1flex -o stage1scan.c stage1scan.l > stage1flex: can't open stage1scan.l Note: stage1scan.c is not necessairy in the "make dist" generated tar.gz file. stage1flex will be build from scan.c (which is distributed), and this will then generate stage1scan.c from scan.l 2016-03-31 Will Estes <westes575@gmail.com> * po/POTFILES.in: gettext: list src/flex.skl in po/POTFILES.in 2016-03-29 rlar <rlar> * src/gen.c: warning in generated code, with -Ca warning: conversion to 'yy_state_type' from 'flex_uint32_t' may change the sign of the result [-Wsign-conversion] 2016-03-29 rlar <rlar> * tests/Makefile.am: suppress `WARNINGFLAGS' for the almost obsolete `noansi' test cases 2016-03-29 rlar <rlar> * configure.ac, src/Makefile.am, tests/Makefile.am: configure option `--enable-warnings' and `WARNINGFLAGS' `WARNINGFLAGS' can be passed when invoking `configure' and when invoking `make' if configure switch `--enable-warnings' was given then default to something useful if we have `GCC' `WARNINGFLAGS' is not used when compiling `stage1flex' to avoid unnecessary clutter 2016-03-31 Tobias Klauser <tklauser@distanz.ch> * src/main.c: Fix potential buffer overflow in strncat() When using clang/llvm 3.8 to compile flex, the following warning is emitted: main.c:378:27: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size] strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ main.c:378:27: note: change the argument to be the free space in the destination buffer minus the terminating null byte strncat(m4_path, m4, sizeof(m4_path)); ^~~~~~~~~~~~~~~ sizeof(m4_path) - strlen(m4_path) - 1Fix it up by using the solution proposed by the warning message. 2016-03-29 Robert.Larice Robert Larice <Robert.Larice@t-online.de> * src/Makefile.am: build: simplified dependency tracking so parallel make runs succeed 2016-03-20 rlar <rlar> * src/flex.skl, src/gen.c, src/main.c: avoid warning in generated code, with -Cf warning: conversion to 'unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-18 Will Estes <westes575@gmail.com> * NEWS, configure.ac: mention v2.6.2; summarize changes since 2.6.1 2016-03-18 Will Estes <westes575@gmail.com> * doc/flex.texi: doc: corrected example in manual, gh#67 2016-03-16 rlar <rlar> * tests/string_nr.l, tests/string_r.l, tests/yyextra.l: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * tests/mem_nr.l, tests/mem_r.l, tests/pthread.l: warning: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion] 2016-03-16 rlar <rlar> * src/flex.skl: warning: conversion to 'flex_uint32_t' from 'long unsigned int' may alter its value [-Wconversion] struct yytbl_reader, member bread is of type flex_uint32_t 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/bison_nr_main.c, tests/bison_nr_parser.y, tests/bison_yylloc_parser.y: warning: redundant redeclaration of '...' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/bison_nr_parser.y, tests/bison_yylloc_parser.y, tests/bison_yylval_parser.y, tests/pthread.l: warning: no previous prototype for '...' [-Wmissing-prototypes] 2016-03-16 rlar <rlar> * tests/multiple_scanners_r_main.c: warning: unused variable 'fp' [-Wunused-variable] 2016-03-16 rlar <rlar> * tests/pthread.l: main(), warning: redundant redeclaration of 'main' [-Wredundant-decls] 2016-03-16 rlar <rlar> * tests/include_by_reentrant.direct.l, tests/lineno_nr.l, tests/lineno_r.l, tests/lineno_trailing.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-16 rlar <rlar> * tests/alloc_extra.l, tests/array_nr.l, tests/array_r.l, tests/basic_nr.l, tests/basic_r.l, tests/ccl.l, tests/debug_nr.l, tests/debug_r.l, tests/extended.l, tests/mem_nr.l, tests/mem_r.l, tests/noansi_r.l, tests/posix.l, tests/posixly_correct.l, tests/prefix_nr.l, tests/prefix_r.l, tests/quotes.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l: main(), warning: old-style function definition [-Wold-style-definition] 2016-03-01 rlar <rlar> * src/ecs.c, src/tblcmp.c: Fix two more casts 2016-03-14 Bastian Köcher <git@kchr.de> * src/gen.c: Fixes yyl compare with unsigned warning 2016-03-13 Robert Larice <Robert.Larice@t-online.de> * configure.ac: Suppress portability warnings in Makefile generation 2016-02-27 rlar <rlar> * src/flex.skl: generated code, in yyensure_buffer_stack(), change type of local `num_to_alloc' which is exclusively used in yy_size_t context 2016-03-01 rlar <rlar> * src/flex.skl: generated code, in yy_get_next_buffer(), change type of local `number_to_move' suits better, because `yy_n_chars' and `yy_buf_size' are of type `int' 2016-02-27 rlar <rlar> * src/flex.skl: generated code, `_yybytes_len' is of type `int', fix code accordingly 2016-02-28 rlar <rlar> * src/gen.c: generated code, `max_size' seems to be of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, here `new_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `yy_buf_size' is of type `int', fix casts accordingly 2016-02-28 rlar <rlar> * src/flex.skl: generated code, `offset' is of type `int' 2016-02-28 rlar <rlar> * src/gen.c: generated code, `yy_more_len' is of type `int' 2016-02-28 rlar <rlar> * src/scan.l: scan.l, rewrite two loops to avoid unneccesairy casting 2016-03-01 rlar <rlar> * src/regex.c, src/tables.c: improve readability 2016-02-28 rlar <rlar> * src/tblcmp.c: another cast in tblcmp.c to avoid warning 2016-02-28 rlar <rlar> * src/buf.c: casts in buf_append() to get rid of warnings 2016-02-28 rlar <rlar> * src/dfa.c, src/gen.c: cast to suite type of flex_uint32_t td_lolen 2016-02-28 rlar <rlar> * src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanopt.c, src/tables_shared.c: cast to get rid of warnings 2016-03-01 rlar <rlar> * src/buf.c, src/main.c: cast and fix usage of log10(), ceil to prevent buffer overflow 2016-03-01 rlar <rlar> * src/tables.c: tables.c, sprinkle casts to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_data_compress(), change type of local newsz to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c, src/tables.h: change type of struct yytbl_writer.total_written to get rid of warnings 2016-02-28 rlar <rlar> * src/tables.c: change argument type of yytbl_writen() to get rid of warnings 2016-03-01 rlar <rlar> * src/tables.c: yytbl_write8/16/32(), change type of local variables to get rid of warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/misc.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: change return type and rename int htoi()/otoi() --> unsigned int htoui()/otoui() 2016-03-01 Will Estes <westes575@gmail.com> * NEWS: Mention 2.6.1 release date 2016-02-28 rlar <rlar> * src/gen.c: avoid warning, add (int) cast to the read() return value For similiarity with the fread() case. 2016-02-28 rlar <rlar> * src/scan.l: avoid warning, POSIX says yyless() has an `int' argument 2016-02-29 rlar <rlar> * src/filter.c: use type size_t in filter_tee_header() to avoid warnings 2016-02-29 rlar <rlar> * src/filter.c, src/misc.c, src/scanopt.c, src/tables.c: add (size_t) casts to malloc invocations to prevent warnings 2016-02-29 rlar <rlar> * src/buf.c, src/misc.c, src/scan.l, src/scanopt.c, src/tables.c: add (int) casts to some strlen() invocations to prevent warnings 2016-02-29 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndlookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: ndinstal(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/flexdef.h, src/scan.l, src/sym.c: cclinstal() and ccllookup(), char *, to get rid of casts and warnings 2016-02-28 rlar <rlar> * src/gen.c: warning: redundant redeclaration of ‘gen_next_state’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/gen.c: warning: no previous prototype for ‘mkecstbl’ [-Wmissing-prototypes] 2016-02-28 rlar <rlar> * src/main.c: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yywrap’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yylval’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h: warning: redundant redeclaration of ‘yyin’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/flexdef.h, src/main.c: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls] 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: unification, rename some more rename these too for improved similiarity: OPTION_OP OPT_HEADER OPT_EXTRA_TYPE OPT_TABLES 2016-02-28 rlar <rlar> * src/parse.y, src/scan.l, src/yylex.c, to.do/unicode/scan.l: fix name clash, OPT_OUTFILE from parse.y and from options.h these collide: OPT_OUTFILE OPT_PREFIX OPT_YYCLASS rename them TOK_... in the parser 2016-02-28 Will Estes <westes575@gmail.com> * lib/reallocarray.c: Prototyped reallocarray implementation 2016-02-28 Will Estes <westes575@gmail.com> * src/scanopt.c: Removed custom strcasecmp() function 2016-02-28 rlar <rlar> * src/flex.skl: fwrite wants a size_t, yyleng is int per posix 2016-02-28 rlar <rlar> * src/scanopt.c: Remove some unneeded casts 2016-02-28 rlar <rlar> * src/flexdef.h: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion] 2016-02-27 rlar <rlar> * src/dfa.c, src/parse.y: dfa.c:157:24: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion] most certainly safe cast 2016-02-27 rlar <rlar> * src/ccl.c: ccl.c:86:19: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion] ch seems to have been checked for proper range some lines above 2016-02-27 rlar <rlar> * tests/bison_nr_parser.y: warning: deprecated directive, use '%pure-parser' [-Wdeprecated] 2016-02-27 rlar <rlar> * lib/lib.c: warning: no previous prototype for 'do_nothing' [-Wmissing-prototypes] 2016-02-27 rlar <rlar> * src/libmain.c: included stdlib.h header 2016-02-27 Will Estes <westes575@gmail.com> * NEWS: Described more post v2.6.0 changes 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: build: Removed bzip2 distribiution archive 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: removed obsolete program check 2016-02-27 Will Estes <westes575@gmail.com> * configure.ac: Made some program checks more robust 2016-02-27 rlar <rlar> * src/flex.skl: Remove unneeded cast to int 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fixed incorrect integer type 2016-02-27 Will Estes <westes575@gmail.com> * src/flex.skl: Fix more integer types, resolves sf 184, 187 2016-02-26 Robert Larice <Robert.Larice@t-online.de> * src/flex.skl, src/gen.c: Removed some type conversion warnings 2016-02-26 Will Estes <westes575@gmail.com> * src/flex.skl: Changed another buffer size to int; resolves gh#61 2016-02-24 Will Estes <westes575@gmail.com> * src/flex.skl: Changed type of yy_n_chars to int; gh#53, sf#160. The variable yy_n_chars had been of type yy_size_t which is incorrect given its use in read(). While it might be adviseable to look at defining a yy_ssize_t, there might be some issues doing this and so, for now, at least, we'll punt back to int. 2016-02-24 Will Estes <westes575@gmail.com> * src/buf.c: Fixed size of bufferallocation, resolved gh#54. The value of n_alloc was a count, not a size. Multiplying the value by the element size was incorrect. That multiplication was already being done and having it done twice was incorrect. 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/scan.l: Allow '%option noline' in flex input file, resolves gh#56. Allow specifying '%option noline' in the input file, leading to the same effect as calling flex with the command line option --noline. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-23 Tobias Klauser <tklauser@distanz.ch> * src/buf.c, src/main.c: Emit no #line directives if gen_line_dirs is false, resolves igh#55. There are two instances in the code which will print a #line directive to the resulting lexer, regardless of the value of gen_line_dirs. Fix them, so they also respect gen_line_dirs. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> 2016-02-16 Tobias Klauser <tklauser@distanz.ch> * lib/lib.c, src/gen.c, src/misc.c, src/scan.l: Converted K&R style function definitions to ANSI C style Consistently make use of the ANSI C function definition style instead of the K&R style. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Used NULL constant instead of plain integer for NULL pointer. The sparse static checker warns about using plain integer 0 as NULL pointers in the generated lexer code. Fix this by using NULL consistently for pointers. 2016-01-29 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Marked declaration and definition of yy_fatal_error as noreturn. Only the declaration of yy_fatal_error is marked with __attribute__((__noreturn__)) in case GCC >= 3 is used, but not the definition. This leads to the sparse static checker to complain about function declaration mismatch. Fix it by defining a macro yynoreturn and using it for both the declaration and the definition of yy_fatal_error. 2016-01-27 Tobias Klauser <tklauser@distanz.ch> * src/flex.skl: Fixed declaration mismatch in yy_fatal_error. The prototype declares yy_fatal_error parameter as "const char msg[]" while the definition uses "const char* msg" (introduced by commit e9d5fc713f61b) which causes the sparse static checkers to produce an error. Fix this by adjusting the definition to use "const char* msg" as well. Also change the C++ version accordingly so it matches the declaration in FlexLexer.hpp. 2016-01-23 Will Estes <westes575@gmail.com> * CODE_OF_CONDUCT.md: flex is for flex #NCoC 2016-01-18 Will Estes <westes575@gmail.com> * doc/flex.texi: Referred to github for issue tracking, no longer sf 2016-01-10 Egor Pugin <egor.pugin@gmail.com> * tests/reject.l4, tests/tableopts.l4: Opened files in binary mode explicitly 2016-01-08 OBATA Akio <obache@NetBSD.org> * src/Makefile.am: Linked flex binary against libintl, not libfl. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> 2016-01-08 Michael van Elst <mlelstv@NetBSD.org> * src/filter.c: Improved pipe-stdin hack behavior; resolves sf#198. Signed-off-by: Thomas <Klausner wiz@NetBSD.org> 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac, src/flexdef.h: Removed no longer needed header checks 2015-12-27 Will Estes <westes575@gmail.com> * configure.ac: Checked for reallocarray() with AC_REPLACE_FUNCS 2015-12-27 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: include libgen.h from flexdef.h, not main.c 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Replace basename2() with basename(3). Given the following program: \#include <libgen.h> \#include <stdio.h> /* extracts basename from path, optionally stripping the extension "\.*" * (same concept as /bin/sh `basename`, but different handling of extension). */ static char *basename2 (char *path) { char *b; for (b = path; *path; path++) if (*path == '/') b = path + 1; return b; } static void basename_compare(char *path) { printf("basename: %s\n", basename(path)); printf("basename2: %s\n\n", basename2(path)); } int main (int argc, char *argv[]) { // From http://pubs.opengroup.org/onlinepubs/9699919799/ // ``Sample Input and Output Strings'' basename_compare("/usr/lib"); basename_compare("/usr/"); basename_compare("/"); basename_compare("///"); basename_compare("//usr//lib//"); return 0; } ... and the program's output: basename: lib basename2: lib basename: usr basename2: basename: / basename2: basename: / basename2: basename: lib basename2: ... we can see that basename2() behaves the same as basename(3) in the average use case, but messes up pretty severely in others. Besides that, basename(3) is mandated by POSIX so should be present on modern Unix-like systems, so we shouldn't define it ourselves. Some notes: - it doesn't appear to be mentioned in POSIX, but OpenBSD's basename(3) returns NULL if the returned path componenet is > PATH_MAX, so add a check for that - basename(3) shouldn't return an empty string, so remove the program_name[0] != '\0' check 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/main.c: Simplify basename2(). It's only call site does not activate the `strip_ext` code path, so the function can be simplified a lot. While here, remove a double assignment. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flex.skl, src/misc.c: Cleaned up __STDC__ #ifdefs. Assuming a compiler conforming to the ISO C standard is used, i.e., __STDC__ is defined to 1, YY_USE_CONST is always defined and can be eliminated. 2015-12-25 Michael Reed <m.reed@mykolab.com> * src/flexdef.h, src/main.c, src/scanopt.c, src/scanopt.h, src/sym.c: Remove remaining use of PROTO 2015-12-21 Serguey Parkhomovsky <xindigo@gmail.com> * src/buf.c: buf.c: use snprintf 2015-12-19 Will Estes <westes575@gmail.com> * configure.ac: build: reformatted AC_CHECK_FUNCS for readability 2015-12-17 Will Estes <westes575@gmail.com> * src/scanopt.c: correct function prototype 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c, src/scanopt.c, src/sym.c, src/tblcmp.c: Remove more instances of PROTO 2015-12-15 Michael Reed <m.reed@mykolab.com> * src/main.c: Removed prototype for main(). It's not called anywhere else so the prototype is not needed. See the C99 standard [1], section 5.1.2.2.1 for more info. [1]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/dfa.c, src/gen.c, src/nfa.c, to.do/unicode/main.c, to.do/unicode/tblcmp.c: Removed more instances of PROTO, ansifying. 2015-12-13 Will Estes <westes575@gmail.com> * README: Noted github for issue tracking and pull requests 2015-12-13 Michael McConville <mmcco@mykolab.com> * README: Reformatted README; removed sf bug tracking link. 2015-12-13 Michael McConville <mmcco@mykolab.com> * src/gen.c, to.do/unicode/gen.c: Removed macros for indentation level. Just increment or decrement the indentation counter. That's less to remember and makes the code more readable. w# Please enter the commit message for your changes. Lines starting 2015-12-12 Mike Frysinger <vapier@gentoo.org> * tests/Makefile.am, tests/testwrapper.sh: tests: fixed paths to input files. The current test wrapper works only when the inputs are specified using relative paths. If they're specified with absolute paths, the driver fails to detect the inputs because it always prepends the input dir name which itself is a relative path: $ cd tests $ ./testwrapper.sh -d . -i $PWD/reject.txt -t ./reject_ver.table <fails to open inputs> This normally doesn't show up because people run `./configure` or, for out of tree builds, `../configure`. But if you happen to run configure with an absolute path, then automake tends to generate absolute paths as well leading to test failures. Fix all of this by dropping the implicit input directory prepending. - INPUT_NAME is often a list of files, not just a single one - the input directory is used to find the testname tables which are usually generated, so it's impossible to use files from both source and build directories - most of the time, the full/correct path is already specified 2015-12-12 Mike Frysinger <vapier@gentoo.org> * configure.ac: configure: fixed realloc test. The [] characters are used for quoting in m4, so the attempt to use them in place of `test` fails yielding the warning at build time: .../flex/configure: line 20222: no: command not found 2015-12-12 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Started removal of PROTO macro. The PROTO macro is no longer needed. Additionally, its usage is inconsistent, so we began removing it. 2015-12-12 Michael Reed <m.reed@mykolab.com> * Makefile.am, src/main.c: Removed SHORT_FILE_NAMES preprocessor symbol. As a relic of MS-DOS, we don't need this. It's never defined; see 13b5b214f53d1c3354a7ab910bd160c126df1331. Removed additional MSDOS ifdef. 2015-12-11 Michael McConville <mmcco@mykolab.com> * configure.ac, lib/reallocarray.c, src/flexdef.h: Added new function reallocarray. This is taken from OpenSSH Portable, which in turn takes it from OpenBSD. reallocarray wraps the stdlib's realloc function. It takes two size arguments and checks for overflow, like calloc, but doesn't zero the memory. Therefore, it allows us to do overflow-safe array reallocations and overflow-safe unzeroed array allocations, which the stdlib allocation functions don't. We have a bunch of specific array allocation macros, none of which check for overflow. reallocarray should be able to replace them. 2015-12-11 Michael McConville <mmcco@mykolab.com> * src/flexdef.h: Removed MS-DOS, VMS macros. Given the age of the MS-DOS and VMS platforms, it's likely that no one is building flex on them any more. Additionally, the preferred approach is to test for particular platform features rather than to test for particular platforms. 2015-12-12 Will Estes <westes575@gmail.com> * src/flexdef.h, src/main.c: Made search for m4 more explicit. 2015-12-12 Will Estes <westes575@gmail.com> * src/flex.skl: Returned 0 from yywrap() instead of EOF 2015-12-11 Will Estes <westes575@gmail.com> * src/libmain.c: Changed end of main() in libmain to exit(0) 2015-12-11 Will Estes <westes575@gmail.com> * NEWS, configure.ac: Mentioned v2.6.1; documented some changes since v2.6.0 2015-12-11 Will Estes <westes575@gmail.com> * README: Updated build documentation; finished sf#155. Removed version numbers for build tools. Noted that version requirements for build tools will be noted in configure.ac. Expanded documentation of building texinfo based docs. 2015-12-11 Will Estes <westes575@gmail.com> * doc/Makefile.am: Removed flex.pdf from distribution; partially fixed sf#155 2015-12-11 Will Estes <westes575@gmail.com> * src/flex.skl: Commented in C style in skeleton; fixed sf#195 2015-12-10 Will Estes <westes575@gmail.com> * .gitignore: Ignored autoscan files 2015-12-09 Will Estes <westes575@gmail.com> * configure.ac: Checked for ranlib and strdup() at configure time 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/tblcmp.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/tblcmp.c: Replace zero_out() with stdlib's memset. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flex.skl: Removed memory allocation casts. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed alloca() configuration. Since alloca() is dangerous, depricated, we remove it. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h: Removed implementation of isascii(). POSIX defines isascii(), so it's likely present on anything weactually build flex on these days. 2015-12-09 Michael McConville <mmcconville@mykolab.com> * src/main.c, src/scanopt.c, src/tables.c: Removed NULL-checks before free() 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/flexdef.h, src/gen.c, src/scan.l, to.do/unicode/flexdef.h, to.do/unicode/scan.l: Removed flex_free()i, corrected buf_destroy logic. As with flex_alloc(), replace with direct calls to free(). The function buf_destroy is now null safe and the logic was corrected to free() correctly. 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/filter.c, src/flexdef.h, src/misc.c, src/scan.l, src/scanflags.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_realloc(). As with flex_alloc(), replace calls to flex_realloc(), which was just a wrapper around realloc(). 2015-12-08 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/filter.c, src/flexdef.h, src/main.c, src/misc.c, src/regex.c, src/scan.l, src/scanflags.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Removed flex_alloc; cleaned up style. The function flex_alloc() was just a wrapper around malloc(). Since this only added unclarity, and the flex_alloc() function is likely a legacy of olden times, remove it in favor of calls to malloc() directly. Style elements cleaned up: * superfluous spacing around parentheses * non-constant initialization in variable declarations * needless casts * almost all uses of assignments as subexpressions 2015-12-07 Michael McConville <mmcconville@mykolab.com> * src/dfa.c, src/flexdef.h, src/gen.c, src/main.c, src/scan.l, src/scanopt.c, tests/bison_nr_scanner.l, tests/bison_yylloc_scanner.l, tests/bison_yylval_scanner.l, tests/mem_nr.l, tests/mem_r.l, tests/pthread.l, tests/string_nr.l, tests/string_r.l, tests/yyextra.l, to.do/unicode/scan.l: Remove allocation casts 2015-12-07 Will Estes <westes575@gmail.com> * src/.gitignore, src/Makefile.am: Built flex with itself. Changes in scan.l need to be built into flex with the same version of flex in some cases. Since this build requirement is minimal, we simply bootstrap flex unconditionally. We intentionally exclude from version control the bootstrap artifacts as the extra copy of the lexer, the intermediate scanner and the bootstrap executable are not of interest. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/buf.c, src/dfa.c, src/main.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, to.do/unicode/main.c, to.do/unicode/scan.l: Use NULL rather than (type *) 0. 2015-12-05 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/sym.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c: Replace copy_unsigned_string() with xstrdup(). Like copy_string(), copy_unsigned_string() is just a clone of the stlib's strdup(). We only use it twice. I'm pretty confident that char signedness is irrelevant in this case. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Cleaned up white space. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/FlexLexer.h: Removed struct keyword before yy_buffer_state 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * examples/testxxLexer.l, src/FlexLexer.h, src/flex.skl, src/main.c: Replaced FLEX_STD macro with std::. The std:: construct exists as of C++98, so we can simply assume it is supported. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * src/Makefile.am: Generated skel.c explicitly in srcdir. Rewrote the target for skel.c to explicitly mention the srcdir. This should help when building flex from a directory outside the flex tree. Spread the rule out over several lines to enhance readability. 2015-12-04 Akim Demaille <akim@lrde.epita.fr> * autogen.sh: Called glibtoolize if libtoolize run fails. On Mac OS X, libtoolize is known as glibtoolize. In cases where libtoolize is not present, then calling glibtoolize when bootstrapping the build system gives more folks a shot at getting flex built from the ground up. 2015-12-02 Mightyjo <mightyjo@gmail.com> * configure.ac: Checked for (g)texi2dvi. Better bison, help2man checks. Added test for presence of (g)texi2dvi program. Gave notice if texi2dvi is unavailable and set TEXI2DVI=: to avoid giving users headaches. Enhanced tests for bison and help2man with notices when the programs aren't found. Set their program variables to use the missing script in build-aux since it's compatible with them. 2015-12-02 Michael McConville <mmcconville@mykolab.com> * src/flexdef.h, src/misc.c, src/parse.y, src/scan.l, src/sym.c, src/tables.c, to.do/unicode/flexdef.h, to.do/unicode/misc.c, to.do/unicode/scan.l: Made string copying more standard. copy_string() was a clone of the stdlib's strdup(). For safety, simplicity, and speed, we should use that instead. We introduce xstrdup() which wraps strdup() in a failure upon memory allocation errors. 2015-11-30 Serguey Parkhomovsky <sergueyparkhomovsky@gmail.com> * src/scan.l: Error on unbalanced parentheses in rules section. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Cleaned up BUILT_SOURCES list. Removed reference to skel.c as a built source since other make rules cover this case. 2015-11-29 Will Estes <westes575@gmail.com> * src/Makefile.am: Sorted file names in flex_SOURCES 2015-11-27 Mightyjo <mightyjo@gmail.com> * src/ecs.c, src/flexdef.h, src/main.c, src/misc.c, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Replaced CHAR macro with unsigned char type. Thanks to Michael McConville for pointing out that the old Char macro causes problems with static analysis. The macro has been removed and replaced with 'unsigned char' throughout the flex sources. The macro is not needed at best and was confusing at worst. It was not used in any of the example files nor was it mentioned in the manual at all. 2015-11-21 Will Estes <westes575@gmail.com> * configure.ac: updated syntax of AC_INIT call as per autoupdate 2015-11-21 Will Estes <westes575@gmail.com> * tests/Makefile.am: removed extra call to a _CPPFLAGS variable 2015-05-14 Stefan Reinauer <stefan.reinauer@coreboot.org> * src/buf.c, src/ccl.c, src/dfa.c, src/ecs.c, src/gen.c, src/main.c, src/misc.c, src/nfa.c, src/parse.y, src/scan.l, src/scanopt.c, src/sym.c, src/tblcmp.c: Switch function definitions from mixed K&R to consistent ANSI C. flex was using K&R function definitions for some functions and ANSI C style in others, sometimes even in the same file. Change the code to consistently use ANSI C. Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> 2015-11-16 Mightyjo <mightyjo@gmail.com> * tests/Makefile.am: Used in-tree header file for c++ tests.
2017-01-02 19:26:30 +03:00
testlex_init(&scanner);
state = test_scan_buffer( buf, len ,scanner);
testlex(scanner);
test_delete_buffer(state,scanner);
testlex_destroy(scanner);
2016-01-09 18:43:18 +03:00
printf("TEST RETURNING OK.\n");
return 0;
}