summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Merge branch 'upstream'Manoj Srivastava2016-07-31
|\ | | | | | | | | | | | | | | | | Signed-off-by: Manoj Srivastava <srivasta@debian.org> # Conflicts: # src/buf.c # src/flex.skl # src/skel.c
| * Imported Upstream version 2.6.1Manoj Srivastava2016-07-31
| |
| * merge tag v2.6.1Manoj Srivastava2016-07-28
| |\ | | | | | | | | | Signed-off-by: Manoj Srivastava <srivasta@debian.org>
| | * avoid warning, add (int) cast to the read() return valuerlar2016-03-01
| | | | | | | | | | | | For similiarity with the fread() case.
| | * avoid warning, POSIX says yyless() has an `int' argumentrlar2016-03-01
| | |
| | * use type size_t in filter_tee_header() to avoid warningsrlar2016-03-01
| | |
| | * add (size_t) casts to malloc invocations to prevent warningsrlar2016-03-01
| | |
| | * add (int) casts to some strlen() invocations to prevent warningsrlar2016-02-29
| | |
| | * ndlookup(), char *, to get rid of casts and warningsrlar2016-02-29
| | |
| | * ndinstal(), char *, to get rid of casts and warningsrlar2016-02-29
| | |
| | * cclinstal() and ccllookup(), char *, to get rid of casts and warningsrlar2016-02-29
| | |
| | * warning: redundant redeclaration of ‘gen_next_state’ [-Wredundant-decls]rlar2016-02-29
| | |
| | * warning: no previous prototype for ‘mkecstbl’ [-Wmissing-prototypes]rlar2016-02-29
| | |
| | * warning: suggest parentheses around assignment used as truth value ↵rlar2016-02-29
| | | | | | | | | | | | [-Wparentheses]
| | * warning: redundant redeclaration of ‘yywrap’ [-Wredundant-decls]rlar2016-02-28
| | |
| | * warning: redundant redeclaration of ‘yylval’ [-Wredundant-decls]rlar2016-02-28
| | |
| | * warning: redundant redeclaration of ‘yyin’ [-Wredundant-decls]rlar2016-02-28
| | |
| | * warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls]rlar2016-02-28
| | |
| | * unification, rename some morerlar2016-02-28
| | | | | | | | | | | | | | | rename these too for improved similiarity: OPTION_OP OPT_HEADER OPT_EXTRA_TYPE OPT_TABLES
| | * fix name clash, OPT_OUTFILE from parse.y and from options.hrlar2016-02-28
| | | | | | | | | | | | | | | | | | these collide: OPT_OUTFILE OPT_PREFIX OPT_YYCLASS rename them TOK_... in the parser
| | * Removed custom strcasecmp() functionWill Estes2016-02-28
| | |
| | * fwrite wants a size_t, yyleng is int per posixrlar2016-02-28
| | |
| | * Remove some unneeded castsrlar2016-02-28
| | |
| | * warning: negative integer implicitly converted to unsigned type ↵rlar2016-02-28
| | | | | | | | | | | | [-Wsign-conversion]
| | * dfa.c:157:24: warning: conversion to 'size_t' from 'int' may change the sign ↵rlar2016-02-27
| | | | | | | | | | | | | | | | | | of the result [-Wsign-conversion] most certainly safe cast
| | * ccl.c:86:19: warning: conversion to 'unsigned char' from 'int' may alter its ↵rlar2016-02-27
| | | | | | | | | | | | | | | | | | value [-Wconversion] ch seems to have been checked for proper range some lines above
| | * included stdlib.h headerrlar2016-02-27
| | |
| | * Remove unneeded cast to intrlar2016-02-27
| | |
| | * Fixed incorrect integer typeWill Estes2016-02-27
| | |
| | * Fix more integer types, resolves sf 184, 187Will Estes2016-02-27
| | |
| | * Removed some type conversion warningsRobert Larice2016-02-26
| | |
| | * Changed another buffer size to int; resolves gh#61Will Estes2016-02-26
| | |
| | * Changed type of yy_n_chars to int; gh#53, sf#160.Will Estes2016-02-24
| | | | | | | | | | | | | | | | | | | | | 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.
| | * Fixed size of bufferallocation, resolved gh#54.Will Estes2016-02-24
| | | | | | | | | | | | 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.
| | * Allow '%option noline' in flex input file, resolves gh#56.Tobias Klauser2016-02-24
| | | | | | | | | | | | | | | | | | | | | 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>
| | * Emit no #line directives if gen_line_dirs is false, resolves igh#55.Tobias Klauser2016-02-24
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * Converted K&R style function definitions to ANSI C styleTobias Klauser2016-02-16
| | | | | | | | | | | | | | | Consistently make use of the ANSI C function definition style instead of the K&R style.
| | * Used NULL constant instead of plain integer for NULL pointer.Tobias Klauser2016-01-29
| | | | | | | | | | | | | | | | | | 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.
| | * Marked declaration and definition of yy_fatal_error as noreturn.Tobias Klauser2016-01-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * Fixed declaration mismatch in yy_fatal_error.Tobias Klauser2016-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * Linked flex binary against libintl, not libfl.OBATA Akio2016-01-08
| | | | | | | | | | | | Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
| | * Improved pipe-stdin hack behavior; resolves sf#198.Michael van Elst2016-01-08
| | | | | | | | | | | | Signed-off-by: Thomas <Klausner wiz@NetBSD.org>
| | * Removed no longer needed header checksWill Estes2015-12-27
| | |
| | * include libgen.h from flexdef.h, not main.cWill Estes2015-12-27
| | |
| | * Replace basename2() with basename(3).Michael Reed2015-12-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Simplify basename2().Michael Reed2015-12-27
| | | | | | | | | | | | | | | | | | 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.
| | * Cleaned up __STDC__ #ifdefs.Michael Reed2015-12-27
| | | | | | | | | | | | | | | | | | 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.
| | * Remove remaining use of PROTOMichael Reed2015-12-25
| | |
| | * buf.c: use snprintfSerguey Parkhomovsky2015-12-21
| | |
| | * correct function prototypeWill Estes2015-12-17
| | |