]> granicus.if.org Git - flex/log
flex
8 years agoMention 2.6.1 release date v2.6.1
Will Estes [Wed, 2 Mar 2016 00:24:24 +0000 (19:24 -0500)]
Mention 2.6.1 release date

8 years agoavoid warning, add (int) cast to the read() return value
rlar [Sun, 28 Feb 2016 18:38:21 +0000 (19:38 +0100)]
avoid warning, add (int) cast to the read() return value

For similiarity with the fread() case.

8 years agoavoid warning, POSIX says yyless() has an `int' argument
rlar [Sun, 28 Feb 2016 09:41:23 +0000 (10:41 +0100)]
avoid warning, POSIX says yyless() has an `int' argument

8 years agouse type size_t in filter_tee_header() to avoid warnings
rlar [Mon, 29 Feb 2016 19:26:18 +0000 (20:26 +0100)]
use type size_t in filter_tee_header() to avoid warnings

8 years agoadd (size_t) casts to malloc invocations to prevent warnings
rlar [Mon, 29 Feb 2016 19:15:29 +0000 (20:15 +0100)]
add (size_t) casts to malloc invocations to prevent warnings

8 years agoadd (int) casts to some strlen() invocations to prevent warnings
rlar [Mon, 29 Feb 2016 18:41:04 +0000 (19:41 +0100)]
add (int) casts to some strlen() invocations to prevent warnings

8 years agondlookup(), char *, to get rid of casts and warnings
rlar [Mon, 29 Feb 2016 17:43:05 +0000 (18:43 +0100)]
ndlookup(), char *, to get rid of casts and warnings

8 years agondinstal(), char *, to get rid of casts and warnings
rlar [Sun, 28 Feb 2016 19:11:49 +0000 (20:11 +0100)]
ndinstal(), char *, to get rid of casts and warnings

8 years agocclinstal() and ccllookup(), char *, to get rid of casts and warnings
rlar [Sun, 28 Feb 2016 19:08:24 +0000 (20:08 +0100)]
cclinstal() and ccllookup(), char *, to get rid of casts and warnings

8 years agowarning: redundant redeclaration of ‘gen_next_state’ [-Wredundant-decls]
rlar [Sun, 28 Feb 2016 14:50:24 +0000 (15:50 +0100)]
warning: redundant redeclaration of ‘gen_next_state’ [-Wredundant-decls]

8 years agowarning: no previous prototype for ‘mkecstbl’ [-Wmissing-prototypes]
rlar [Sun, 28 Feb 2016 14:50:46 +0000 (15:50 +0100)]
warning: no previous prototype for ‘mkecstbl’ [-Wmissing-prototypes]

8 years agowarning: suggest parentheses around assignment used as truth value [-Wparentheses]
rlar [Sun, 28 Feb 2016 15:32:59 +0000 (16:32 +0100)]
warning: suggest parentheses around assignment used as truth value [-Wparentheses]

8 years agowarning: redundant redeclaration of ‘yywrap’ [-Wredundant-decls]
rlar [Sun, 28 Feb 2016 13:21:49 +0000 (14:21 +0100)]
warning: redundant redeclaration of ‘yywrap’ [-Wredundant-decls]

8 years agowarning: redundant redeclaration of ‘yylval’ [-Wredundant-decls]
rlar [Sun, 28 Feb 2016 12:52:26 +0000 (13:52 +0100)]
warning: redundant redeclaration of ‘yylval’ [-Wredundant-decls]

8 years agowarning: redundant redeclaration of ‘yyin’ [-Wredundant-decls]
rlar [Sun, 28 Feb 2016 12:49:44 +0000 (13:49 +0100)]
warning: redundant redeclaration of ‘yyin’ [-Wredundant-decls]

8 years agowarning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls]
rlar [Sun, 28 Feb 2016 13:20:14 +0000 (14:20 +0100)]
warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls]

8 years agounification, rename some more
rlar [Sun, 28 Feb 2016 13:19:04 +0000 (14:19 +0100)]
unification, rename some more

rename these too for improved similiarity:
  OPTION_OP OPT_HEADER OPT_EXTRA_TYPE OPT_TABLES

8 years agofix name clash, OPT_OUTFILE from parse.y and from options.h
rlar [Sun, 28 Feb 2016 13:17:36 +0000 (14:17 +0100)]
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

8 years agoPrototyped reallocarray implementation
Will Estes [Sun, 28 Feb 2016 21:23:19 +0000 (16:23 -0500)]
Prototyped reallocarray implementation

8 years agoRemoved custom strcasecmp() function
Will Estes [Sun, 28 Feb 2016 20:51:57 +0000 (15:51 -0500)]
Removed custom strcasecmp() function

8 years agofwrite wants a size_t, yyleng is int per posix
rlar [Sun, 28 Feb 2016 09:46:37 +0000 (10:46 +0100)]
fwrite wants a size_t, yyleng is int per posix

8 years agoRemove some unneeded casts
rlar [Sun, 28 Feb 2016 10:54:00 +0000 (11:54 +0100)]
Remove some unneeded casts

8 years agowarning: negative integer implicitly converted to unsigned type [-Wsign-conversion]
rlar [Sun, 28 Feb 2016 10:42:41 +0000 (11:42 +0100)]
warning: negative integer implicitly converted to unsigned type [-Wsign-conversion]

8 years agodfa.c:157:24: warning: conversion to 'size_t' from 'int' may change the sign of the...
rlar [Sat, 27 Feb 2016 18:10:48 +0000 (19:10 +0100)]
dfa.c:157:24: warning: conversion to 'size_t' from 'int' may change the sign of the result [-Wsign-conversion]

most certainly safe cast

8 years agoccl.c:86:19: warning: conversion to 'unsigned char' from 'int' may alter its value...
rlar [Sat, 27 Feb 2016 18:08:04 +0000 (19:08 +0100)]
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

8 years agowarning: deprecated directive, use '%pure-parser' [-Wdeprecated]
rlar [Sat, 27 Feb 2016 16:42:52 +0000 (17:42 +0100)]
warning: deprecated directive, use '%pure-parser' [-Wdeprecated]

8 years agowarning: no previous prototype for 'do_nothing' [-Wmissing-prototypes]
rlar [Sat, 27 Feb 2016 16:27:11 +0000 (17:27 +0100)]
warning: no previous prototype for 'do_nothing' [-Wmissing-prototypes]

8 years agoincluded stdlib.h header
rlar [Sat, 27 Feb 2016 15:18:29 +0000 (16:18 +0100)]
included stdlib.h header

8 years agoDescribed more post v2.6.0 changes
Will Estes [Sat, 27 Feb 2016 21:23:11 +0000 (16:23 -0500)]
Described more post v2.6.0 changes

8 years agobuild: Removed bzip2 distribiution archive
Will Estes [Sat, 27 Feb 2016 20:45:34 +0000 (15:45 -0500)]
build: Removed bzip2 distribiution archive

8 years agoremoved obsolete program check
Will Estes [Sat, 27 Feb 2016 20:41:59 +0000 (15:41 -0500)]
removed obsolete program check

8 years agoMade some program checks more robust
Will Estes [Sat, 27 Feb 2016 20:35:33 +0000 (15:35 -0500)]
Made some program checks more robust

8 years agoRemove unneeded cast to int
rlar [Sat, 27 Feb 2016 17:31:33 +0000 (18:31 +0100)]
Remove unneeded cast to int

8 years agoFixed incorrect integer type
Will Estes [Sat, 27 Feb 2016 16:56:05 +0000 (11:56 -0500)]
Fixed incorrect integer type

8 years agoFix more integer types, resolves sf 184, 187
Will Estes [Sat, 27 Feb 2016 14:43:00 +0000 (09:43 -0500)]
Fix more integer types, resolves sf 184, 187

8 years agoRemoved some type conversion warnings
Robert Larice [Sat, 27 Feb 2016 01:23:05 +0000 (20:23 -0500)]
Removed some type conversion warnings

8 years agoChanged another buffer size to int; resolves gh#61
Will Estes [Fri, 26 Feb 2016 19:23:33 +0000 (14:23 -0500)]
Changed another buffer size to int; resolves gh#61

8 years agoChanged type of yy_n_chars to int; gh#53, sf#160.
Will Estes [Thu, 25 Feb 2016 01:11:24 +0000 (20:11 -0500)]
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.

8 years agoFixed size of bufferallocation, resolved gh#54.
Will Estes [Wed, 24 Feb 2016 22:50:00 +0000 (17:50 -0500)]
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.

8 years agoAllow '%option noline' in flex input file, resolves gh#56.
Tobias Klauser [Tue, 23 Feb 2016 14:39:24 +0000 (15:39 +0100)]
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>
8 years agoEmit no #line directives if gen_line_dirs is false, resolves igh#55.
Tobias Klauser [Tue, 23 Feb 2016 14:59:42 +0000 (15:59 +0100)]
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>
8 years agoConverted K&R style function definitions to ANSI C style
Tobias Klauser [Tue, 16 Feb 2016 13:35:34 +0000 (14:35 +0100)]
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.

8 years agoUsed NULL constant instead of plain integer for NULL pointer.
Tobias Klauser [Fri, 29 Jan 2016 13:31:54 +0000 (14:31 +0100)]
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.

8 years agoMarked declaration and definition of yy_fatal_error as noreturn.
Tobias Klauser [Fri, 29 Jan 2016 13:26:23 +0000 (14:26 +0100)]
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.

8 years agoFixed declaration mismatch in yy_fatal_error.
Tobias Klauser [Wed, 27 Jan 2016 12:58:08 +0000 (13:58 +0100)]
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.

8 years agoflex is for flex #NCoC
Will Estes [Sat, 23 Jan 2016 16:43:07 +0000 (11:43 -0500)]
flex is for flex #NCoC

8 years agoReferred to github for issue tracking, no longer sf
Will Estes [Mon, 18 Jan 2016 21:00:04 +0000 (16:00 -0500)]
Referred to github for issue tracking, no longer sf

8 years agoOpened files in binary mode explicitly
Egor Pugin [Sun, 10 Jan 2016 20:43:47 +0000 (15:43 -0500)]
Opened files in binary mode explicitly

8 years agoLinked flex binary against libintl, not libfl.
OBATA Akio [Fri, 8 Jan 2016 20:23:18 +0000 (15:23 -0500)]
Linked flex binary against libintl, not libfl.

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
8 years agoImproved pipe-stdin hack behavior; resolves sf#198.
Michael van Elst [Fri, 8 Jan 2016 20:07:57 +0000 (15:07 -0500)]
Improved pipe-stdin hack behavior; resolves sf#198.

Signed-off-by: Thomas <Klausner wiz@NetBSD.org>
8 years agoRemoved no longer needed header checks
Will Estes [Sun, 27 Dec 2015 19:05:51 +0000 (14:05 -0500)]
Removed no longer needed header checks

8 years agoChecked for reallocarray() with AC_REPLACE_FUNCS
Will Estes [Sun, 27 Dec 2015 18:57:13 +0000 (13:57 -0500)]
Checked for reallocarray() with AC_REPLACE_FUNCS

8 years agoinclude libgen.h from flexdef.h, not main.c
Will Estes [Sun, 27 Dec 2015 18:46:37 +0000 (13:46 -0500)]
include libgen.h from flexdef.h, not main.c

8 years agoReplace basename2() with basename(3).
Michael Reed [Fri, 25 Dec 2015 19:49:33 +0000 (14:49 -0500)]
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

8 years agoSimplify basename2().
Michael Reed [Fri, 25 Dec 2015 19:39:18 +0000 (14:39 -0500)]
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.

8 years agoCleaned up __STDC__ #ifdefs.
Michael Reed [Fri, 25 Dec 2015 19:15:15 +0000 (14:15 -0500)]
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.

8 years agoRemove remaining use of PROTO
Michael Reed [Fri, 25 Dec 2015 19:01:24 +0000 (14:01 -0500)]
Remove remaining use of PROTO

8 years agobuf.c: use snprintf
Serguey Parkhomovsky [Mon, 21 Dec 2015 22:40:24 +0000 (14:40 -0800)]
buf.c: use snprintf

8 years agobuild: reformatted AC_CHECK_FUNCS for readability
Will Estes [Sat, 19 Dec 2015 21:17:31 +0000 (16:17 -0500)]
build: reformatted AC_CHECK_FUNCS for readability

8 years agocorrect function prototype
Will Estes [Thu, 17 Dec 2015 21:45:14 +0000 (16:45 -0500)]
correct function prototype

8 years agoRemove more instances of PROTO
Michael Reed [Tue, 15 Dec 2015 20:08:50 +0000 (15:08 -0500)]
Remove more instances of PROTO

8 years agoRemoved prototype for main().
Michael Reed [Tue, 15 Dec 2015 19:47:33 +0000 (14:47 -0500)]
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

8 years agoRemoved more instances of PROTO, ansifying.
Michael McConville [Sun, 13 Dec 2015 06:20:11 +0000 (01:20 -0500)]
Removed more instances of PROTO, ansifying.

8 years agoNoted github for issue tracking and pull requests
Will Estes [Mon, 14 Dec 2015 00:41:19 +0000 (19:41 -0500)]
Noted github for issue tracking and pull requests

8 years agoReformatted README; removed sf bug tracking link.
Michael McConville [Sun, 13 Dec 2015 22:55:47 +0000 (17:55 -0500)]
Reformatted README; removed sf bug tracking link.

8 years agoRemoved macros for indentation level.
Michael McConville [Sun, 13 Dec 2015 22:44:20 +0000 (17:44 -0500)]
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

8 years agotests: fixed paths to input files.
Mike Frysinger [Sun, 13 Dec 2015 04:28:43 +0000 (23:28 -0500)]
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

8 years agoconfigure: fixed realloc test.
Mike Frysinger [Sun, 13 Dec 2015 04:17:00 +0000 (23:17 -0500)]
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

8 years agoStarted removal of PROTO macro.
Michael McConville [Sat, 12 Dec 2015 05:38:53 +0000 (00:38 -0500)]
Started removal of PROTO macro.

The PROTO macro is no longer needed. Additionally, its usage is inconsistent,
so we began removing it.

8 years agoRemoved SHORT_FILE_NAMES preprocessor symbol.
Michael Reed [Sat, 12 Dec 2015 20:17:53 +0000 (15:17 -0500)]
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.

8 years agoAdded new function reallocarray.
Michael McConville [Sat, 12 Dec 2015 04:04:36 +0000 (23:04 -0500)]
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.

8 years agoRemoved MS-DOS, VMS macros.
Michael McConville [Sat, 12 Dec 2015 04:42:19 +0000 (23:42 -0500)]
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.

8 years agoMade search for m4 more explicit.
Will Estes [Sat, 12 Dec 2015 16:03:05 +0000 (11:03 -0500)]
Made search for m4 more explicit.

8 years agoReturned 0 from yywrap() instead of EOF
Will Estes [Sat, 12 Dec 2015 12:35:23 +0000 (07:35 -0500)]
Returned 0 from yywrap() instead of EOF

8 years agoChanged end of main() in libmain to exit(0)
Will Estes [Sat, 12 Dec 2015 01:25:50 +0000 (20:25 -0500)]
Changed end of main() in libmain to exit(0)

8 years agoMentioned v2.6.1; documented some changes since v2.6.0
Will Estes [Fri, 11 Dec 2015 15:57:46 +0000 (10:57 -0500)]
Mentioned v2.6.1; documented some changes since v2.6.0

8 years agoUpdated build documentation; finished sf#155.
Will Estes [Fri, 11 Dec 2015 15:41:08 +0000 (10:41 -0500)]
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.

8 years agoRemoved flex.pdf from distribution; partially fixed sf#155
Will Estes [Fri, 11 Dec 2015 15:40:34 +0000 (10:40 -0500)]
Removed flex.pdf from distribution; partially fixed sf#155

8 years agoCommented in C style in skeleton; fixed sf#195
Will Estes [Fri, 11 Dec 2015 14:45:14 +0000 (09:45 -0500)]
Commented in C style in skeleton; fixed sf#195

8 years agoIgnored autoscan files
Will Estes [Thu, 10 Dec 2015 15:05:59 +0000 (10:05 -0500)]
Ignored autoscan files

8 years agoChecked for ranlib and strdup() at configure time
Will Estes [Thu, 10 Dec 2015 00:39:20 +0000 (19:39 -0500)]
Checked for ranlib and strdup() at configure time

8 years agoReplace zero_out() with stdlib's memset.
Michael McConville [Wed, 9 Dec 2015 21:22:11 +0000 (16:22 -0500)]
Replace zero_out() with stdlib's memset.

8 years agoRemoved memory allocation casts.
Michael McConville [Wed, 9 Dec 2015 21:14:41 +0000 (16:14 -0500)]
Removed memory allocation casts.

8 years agoRemoved alloca() configuration.
Michael McConville [Wed, 9 Dec 2015 19:20:40 +0000 (14:20 -0500)]
Removed alloca() configuration.

Since alloca() is dangerous, depricated, we remove it.

8 years agoRemoved implementation of isascii().
Michael McConville [Wed, 9 Dec 2015 19:13:05 +0000 (14:13 -0500)]
Removed implementation of isascii().

POSIX defines isascii(), so it's likely present on anything weactually build flex on these days.

8 years agoRemoved NULL-checks before free()
Michael McConville [Wed, 9 Dec 2015 18:03:57 +0000 (13:03 -0500)]
Removed NULL-checks before free()

8 years agoRemoved flex_free()i, corrected buf_destroy logic.
Michael McConville [Wed, 9 Dec 2015 02:16:52 +0000 (21:16 -0500)]
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.

8 years agoRemoved flex_realloc().
Michael McConville [Wed, 9 Dec 2015 02:12:21 +0000 (21:12 -0500)]
Removed flex_realloc().

As with flex_alloc(), replace calls to flex_realloc(), which was just a
wrapper around realloc().

8 years agoRemoved flex_alloc; cleaned up style.
Michael McConville [Wed, 9 Dec 2015 02:00:39 +0000 (21:00 -0500)]
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

8 years agoRemove allocation casts
Michael McConville [Tue, 8 Dec 2015 00:44:10 +0000 (19:44 -0500)]
Remove allocation casts

8 years agoBuilt flex with itself.
Will Estes [Mon, 7 Dec 2015 20:37:01 +0000 (15:37 -0500)]
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.

8 years agoUse NULL rather than (type *) 0.
Michael McConville [Sat, 5 Dec 2015 23:00:12 +0000 (18:00 -0500)]
Use NULL rather than (type *) 0.

8 years agoReplace copy_unsigned_string() with xstrdup().
Michael McConville [Sat, 5 Dec 2015 22:42:40 +0000 (17:42 -0500)]
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.

8 years agoCleaned up white space.
Akim Demaille [Fri, 4 Dec 2015 15:56:47 +0000 (16:56 +0100)]
Cleaned up white space.

8 years agoRemoved struct keyword before yy_buffer_state
Akim Demaille [Fri, 4 Dec 2015 15:41:47 +0000 (16:41 +0100)]
Removed struct keyword before yy_buffer_state

8 years agoReplaced FLEX_STD macro with std::.
Akim Demaille [Fri, 4 Dec 2015 15:39:39 +0000 (16:39 +0100)]
Replaced FLEX_STD macro with std::.

The std:: construct exists as of C++98, so we can simply assume it is
supported.

8 years agoGenerated skel.c explicitly in srcdir.
Akim Demaille [Fri, 4 Dec 2015 15:37:03 +0000 (16:37 +0100)]
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.

8 years agoCalled glibtoolize if libtoolize run fails.
Akim Demaille [Fri, 4 Dec 2015 15:36:17 +0000 (16:36 +0100)]
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.

8 years agoChecked for (g)texi2dvi. Better bison, help2man checks.
Mightyjo [Thu, 3 Dec 2015 02:25:11 +0000 (21:25 -0500)]
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.

8 years agoMade string copying more standard.
Michael McConville [Wed, 2 Dec 2015 16:32:42 +0000 (11:32 -0500)]
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.