| Commit message (Collapse) | Author | Age |
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
# Conflicts:
# src/buf.c
# src/flex.skl
# src/skel.c
|
| | |
|
| |\
| | |
| | |
| | | |
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
| | |
| | |
| | |
| | | |
For similiarity with the fread() case.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
[-Wparentheses]
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
rename these too for improved similiarity:
OPTION_OP OPT_HEADER OPT_EXTRA_TYPE OPT_TABLES
|
| | |
| | |
| | |
| | |
| | |
| | | |
these collide:
OPT_OUTFILE OPT_PREFIX OPT_YYCLASS
rename them TOK_... in the parser
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
[-Wsign-conversion]
|
| | |
| | |
| | |
| | |
| | |
| | | |
of the result [-Wsign-conversion]
most certainly safe cast
|
| | |
| | |
| | |
| | |
| | |
| | | |
value [-Wconversion]
ch seems to have been checked for proper range some lines above
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | | |
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 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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | | |
Consistently make use of the ANSI C function definition style instead of
the K&R style.
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | | |
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
|
| | |
| | |
| | |
| | | |
Signed-off-by: Thomas <Klausner wiz@NetBSD.org>
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
|
| | | |
|
| | | |
|