Skip to content

Commit

Permalink
Add "lexparse.h" headers for lexer/parser integration (#112)
Browse files Browse the repository at this point in the history
And include them in a few strategic places.  This avoids build
failures with future compilers that do not support implicit function
declarations by default.

(NB: This commit does not regenerate the lexers/parsers, so the
line numbers are slightly off.)
  • Loading branch information
fweimer-rh authored Jul 2, 2023
1 parent 564dd86 commit 9a99f20
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sslutils/lex.namespaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,7 @@ static yyconst flex_int16_t yy_rule_linenum[15] =
#include <stdlib.h>

#include "parsertypes.h"
#include "lexparse.h"
#include "namespaces.h"
#ifndef strndup
extern char *strndup(const char*, size_t);
Expand Down
1 change: 1 addition & 0 deletions src/sslutils/lex.signing.c
Original file line number Diff line number Diff line change
Expand Up @@ -2356,6 +2356,7 @@ static yyconst flex_int16_t yy_rule_linenum[17] =

#include "parsertypes.h"
#include "signing_policy.h"
#include "lexparse.h"
#ifndef strndup
extern char *strndup(const char*, size_t);
#endif
Expand Down
4 changes: 4 additions & 0 deletions src/sslutils/lexparse.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Declarations for lexer/parser integration. */
union YYSTYPE;
int signinglex (union YYSTYPE *, void *);
int namespaceslex (union YYSTYPE *, void *);
1 change: 1 addition & 0 deletions src/sslutils/namespaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
#include <stdlib.h>

#include "parsertypes.h"
#include "lexparse.h"
#include "listfunc.h"

char **parse_subjects(char *string);
Expand Down
1 change: 1 addition & 0 deletions src/sslutils/namespaces.l
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <stdlib.h>

#include "parsertypes.h"
#include "lexparse.h"
#include "namespaces.h"
#ifndef strndup
extern char *strndup(const char*, size_t);
Expand Down
1 change: 1 addition & 0 deletions src/sslutils/namespaces.y
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <stdlib.h>

#include "parsertypes.h"
#include "lexparse.h"
#include "listfunc.h"

char **parse_subjects(char *string);
Expand Down
1 change: 1 addition & 0 deletions src/sslutils/signing_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
#include <ctype.h>

#include "parsertypes.h"
#include "lexparse.h"
#include "listfunc.h"

char **parse_subjects(char *string);
Expand Down
1 change: 1 addition & 0 deletions src/sslutils/signing_policy.l
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include "parsertypes.h"
#include "signing_policy.h"
#include "lexparse.h"
#ifndef strndup
extern char *strndup(const char*, size_t);
#endif
Expand Down
1 change: 1 addition & 0 deletions src/sslutils/signing_policy.y
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <ctype.h>

#include "parsertypes.h"
#include "lexparse.h"
#include "listfunc.h"

char **parse_subjects(char *string);
Expand Down
1 change: 1 addition & 0 deletions src/utils/lex.yy.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ char *yytext;

#include "fakeparsertypes.h"
#include "vomsparser.h"
#include "lexparse.h"

#line 491 "lex.yy.c"

Expand Down
4 changes: 4 additions & 0 deletions src/utils/lexparse.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Declarations for lexer/parser integration. */
union YYSTYPE;
int yylex();
void yyerror(const char *);
1 change: 1 addition & 0 deletions src/utils/vomsfake.y
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <string.h>

#include "fakeparsertypes.h"
#include "lexparse.h"

#define MAX_SIZE 200

Expand Down
1 change: 1 addition & 0 deletions src/utils/vomsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
#include <string.h>

#include "fakeparsertypes.h"
#include "lexparse.h"

#define MAX_SIZE 200

Expand Down
1 change: 1 addition & 0 deletions src/utils/vomsparser.l
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include "fakeparsertypes.h"
#include "vomsparser.h"
#include "lexparse.h"
%}

%x STR
Expand Down

0 comments on commit 9a99f20

Please sign in to comment.