profile
viewpoint

camwebb/gawk-aregex 0

Gawk extension for approximate regex matching, using the TRE regex library

jannick0/autoconf 0

git://git.savannah.gnu.org/autoconf.git

jannick0/autoconf-archive 0

A mirror of the GNU Autoconf Archive, a collection of more than 500 macros for GNU Autoconf that have been contributed as free software by friendly supporters of the cause from all over the Internet.

jannick0/awk-language-server 0

An awk language server for Visual Studio Code

jannick0/awka 0

Revive awka - Awk to C Compiler

jannick0/bakefile 0

Bakefile makefiles generator

jannick0/bison 0

GNU Bison

jannick0/cppcheck 0

static analysis of C/C++ code

jannick0/ctags 0

A maintained ctags implementation

issue commentGenivia/RE-flex

Handling of encodings other than UTF-8

I am not sure I explained clearly what I am after. Currently, it is possible to specify a FILE* input source along with a file encoding, with the

  Input(
      FILE                 *file,        ///< input file
      file_encoding_type    enc,         ///< file_encoding (when UTF BOM is not present)
      const unsigned short *page = NULL) ///< code page for file_encoding::custom

constructor. In this case, IIUC, RE/flex internally transcodes the input from the specified encoding to UTF-8 expected by the scanner internals in the Input::file_get() method.

It would be great if this functionality could be exposed for Input::Input(std::istream) sources as well. It is possible to interpose the transcoding between the application and RE/flex, but this requires essentially duplicating code and codepages data that is already in RE/flex.

dnicolodi

comment created time in 2 hours

issue commentGenivia/RE-flex

Handling of encodings other than UTF-8

Support for std::istream UTF-16/32 input formats could be implemented with a derived class of std::streambuf to read another std::istream as input to produce a UTF-8 normalized std::istream. This should not be too hard to do, so perhaps someone has already done that as a general open source project? To do this on our end, the basics would be similar to the gzip decompressor gz.l example of RE/flex, but reading a std::istream to convert.

dnicolodi

comment created time in 5 hours

issue openedjgarzik/sqlfun

Parse fails for "select null" or "select (<expr>)"

EIther of the following two inputs fail:

select null from t;
select (1) from t;

These are easily fixed by adding the following right-hand productions to expr:

NULLX
'(' expr ')'

along with the corresponding output actions.

Rather than a pull request, here's a full git patch for fixing these issues, though you may want to modify sqlp_null() and sqlp_expr_paren(). Could you please merge into master?

diff --git a/exec.c b/exec.c
index d1d11d0..e918842 100644
--- a/exec.c
+++ b/exec.c
@@ -174,6 +174,11 @@ void sqlp_bool(struct psql_state *pstate, int val)
 	boolout("BOOL", val);
 }
 
+void sqlp_null(struct psql_state *pstate)
+{
+        strout("CONST", "NULL"); /* probably this should be a different function */
+}
+
 void sqlp_call(struct psql_state *pstate, int n_args, const char *name)
 {
 	json_t *obj = json_object();
@@ -397,6 +402,11 @@ void sqlp_expr_is_in(struct psql_state *pstate, int val)
 	boolout("EXPR-IS-IN", val);
 }
 
+void sqlp_expr_paren(struct psql_state *pstate)
+{
+        opout("PARENS"); /* probably this should be a different function */
+}
+
 void sqlp_expr_op(struct psql_state *pstate, enum sqlp_expr_ops op)
 {
 	strout("EXPR-OP", op_names[op]);
diff --git a/sql-parser.h b/sql-parser.h
index c78c34e..32829bb 100644
--- a/sql-parser.h
+++ b/sql-parser.h
@@ -67,6 +67,7 @@ extern void sqlp_alias(struct psql_state *pstate, const char *alias);
 extern void sqlp_assign(struct psql_state *pstate, const char *db_name, const char *name);
 extern void sqlp_assign_at(struct psql_state *pstate, const char *name);
 extern void sqlp_bool(struct psql_state *pstate, int val);
+extern void sqlp_null(struct psql_state *pstate);
 extern void sqlp_call(struct psql_state *pstate, int n_args, const char *name);
 extern void sqlp_call_date(struct psql_state *pstate, int n_args, enum sqlp_expr_ops op);
 extern void sqlp_call_trim_opts(struct psql_state *pstate, int trim_opts);
@@ -104,6 +105,7 @@ extern void sqlp_expr_cmp(struct psql_state *pstate, int comp);
 extern void sqlp_expr_cmp_sel(struct psql_state *pstate, int sel_type, int comp);
 extern void sqlp_expr_is_bool(struct psql_state *pstate, int val);
 extern void sqlp_expr_is_in(struct psql_state *pstate, int val);
+extern void sqlp_expr_paren(struct psql_state *pstate);
 extern void sqlp_fieldname(struct psql_state *pstate, const char *db_name, const char *name);
 extern void sqlp_float(struct psql_state *pstate, float val);
 extern void sqlp_group_by_list(struct psql_state *pstate, int n_list, int opts);
diff --git a/sql.y b/sql.y
index 5d149df..a5a28db 100644
--- a/sql.y
+++ b/sql.y
@@ -848,6 +848,7 @@ expr: NAME          { sqlp_name(pstate, $1); free($1); }
    | INTNUM        { sqlp_number(pstate, $1); }
    | APPROXNUM     { sqlp_float(pstate, $1); }
    | BOOL          { sqlp_bool(pstate, $1); }
+   | NULLX         { sqlp_null(pstate); }
    ;
 
 expr: expr '+' expr { sqlp_expr_op(pstate, SEO_ADD); }
@@ -959,6 +960,8 @@ expr: CURRENT_TIMESTAMP { sqlp_now(pstate); };
 expr: BINARY expr %prec UMINUS { sqlp_expr_op(pstate, SEO_STRTOBIN); }
    ;
 
+expr: '(' expr ')'      { sqlp_expr_paren(pstate); }
+
 %%
 
 void

created time in 3 days

issue openedGenivia/RE-flex

Handling of encodings other than UTF-8

The handling of encodings other than UTF-8 is restricted to FILE* input. I was hoping that the same on-the-fly transcoding would work for std::istream inputs, but this does not seem the case. Is this something that can be implemented or there are technical reasons why it is not possible to re-use the same mechanisms?

created time in 3 days

push eventakimd/bison

Akim Demaille

commit sha 336089123f10579fef4bbf1f2f8d3423e752bf3a

gnulib: update * Makefile.am (gitsort): New. Use it.

view details

Martin Rehak

commit sha 2ca158c893ed6a568c582d9c006bdc209a63267c

examples: avoid "unbound variable" errors When the shell option `nounset` is set, we may get "unbound variable" errors. https://lists.gnu.org/r/bug-bison/2020-11/msg00013.html * examples/test (diff_opts): Be sure to initialize it.

view details

Adela Vais

commit sha 10305f3e941591f1f915402f1c1076024129e624

d: change the return value of yylex from TokenKind to YYParser.Symbol The complete symbol approach was deemed to be the right approach for Dlang. Now, the user can return from yylex() an instance of YYParser.Symbol structure, which binds together the TokenKind, the semantic value and the location. Before, the last two were reported separately to the parser. Only the user API is changed, Bisons's internal structure is kept the same. * data/skeletons/d.m4 (struct YYParser.Symbol): New. * data/skeletons/lalr1.d: Change the return value. * doc/bison.texi: Document it. * examples/d/calc/calc.y, examples/d/simple/calc.y: Demonstrate it. * tests/calc.at, tests/scanner.at: Test it.

view details

Adela Vais

commit sha e5854bbddd10d6b834622dc1e6b67c91b9c43f48

d: change YYLocation's type from class to struct This avoids heap allocation and gives minimal costs for the creation and destruction of the YYParser.Symbol struct if the location tracking is active. Suggested by H. S. Teoh. * data/skeletons/lalr1.d: Here. * doc/bison.texi: Document it. * examples/d/calc/calc.y: Adjust. * tests/calc.at: Test it.

view details

Akim Demaille

commit sha 562930513186780619ee22e541d86ddf896d61e9

doc: using stow to set up a bison herd * README-hacking.md (Stow): New.

view details

push time in 4 days

push eventakimd/bison

Adela Vais

commit sha 793f22de0b3ff34b89020d3a3a583103dbd1fa83

d: change the return value of yylex from TokenKind to YYParser.Symbol The complete symbol approach was deemed to be the right approach for Dlang. Now, the user can return from yylex() an instance of YYParser.Symbol structure, which binds together the TokenKind, the semantic value and the location. Before, the last two were reported separately to the parser. Only the user API is changed, Bisons's internal structure is kept the same. * data/skeletons/d.m4 (struct YYParser.Symbol): New. * data/skeletons/lalr1.d: Change the return value. * doc/bison.texi: Document it. * examples/d/calc/calc.y, examples/d/simple/calc.y: Demonstrate it. * tests/calc.at, tests/scanner.at: Test it.

view details

Adela Vais

commit sha 58573701adff83a04379380aed97d8346c26b298

d: change YYLocation's type from class to struct This avoids heap allocation and gives minimal costs for the creation and destruction of the YYParser.Symbol struct if the location tracking is active. Suggested by H. S. Teoh. * data/skeletons/lalr1.d: Here. * doc/bison.texi: Document it. * examples/d/calc/calc.y: Adjust. * tests/calc.at: Test it.

view details

push time in 4 days

PR opened akimd/bison

Complete external symbols squash
+106 -77

0 comment

8 changed files

pr created time in 4 days

push eventakimd/bison

Adela Vais

commit sha 593724366f714e6c0316c51716cc507309ea9030

d: add support for lookahead correction When using lookahead correction, the method YYParser.Context.getExpectedTokens is not annotated with const, because the method calls yylacCheck, which is not const. Also, because of yylacStack and yylacEstablished, yylacCheck needs to be called from the context of the parser class, which is sent as parameter to the Context's constructor. * data/skeletons/lalr1.d (yylacCheck, yylacEstablish, yylacDiscard, yylacStack, yylacEstablished): New. (Context): Use it. * doc/bison.texi: Document it. * tests/calc.at: Check it.

view details

push time in 6 days

PR merged akimd/bison

d: add support for lookahead correction

When using lookahead correction, the method YYParser.Context.getExpectedTokens is not annotated with const, because the method calls yylacCheck, which is not const. Also, because of yylacStack and yylacEstablished, yylacCheck needs to be called from the context of the parser class, which is sent as parameter to the Context's constructor.

  • data/skeletons/lalr1.d (yylacCheck, yylacEstablish, yylacDiscard, yylacStack, yylacEstablished): New. (Context): Use it.
  • doc/bison.texi: Document it.
  • tests/calc.at: Check it.
+229 -25

0 comment

3 changed files

adelavais

pr closed time in 6 days

push eventakimd/bison

Adela Vais

commit sha 0e51f6146ad32126b9fce26fb8de34c3d2f727e6

d: change the name of the custom error message function to reportSyntaxError Changed from syntax_error to reportSyntaxError to be similar to the Java parser. * data/skeletons/lalr1.d: Change the function name. * doc/bison.texi: Document it. * tests/local.at: Adjust.

view details

push time in 6 days

PR merged akimd/bison

d: change the name of the custom error message function to reportSynt…

…axError

Changed from syntax_error to reportSyntaxError to be similar to the Java parser.

  • data/skeletons/lalr1.d: Change the function name.
  • doc/bison.texi: Document it.
  • tests/local.at: Adjust.
+5 -5

0 comment

3 changed files

adelavais

pr closed time in 6 days

issue commentakimd/bison

glr2.cc skeleton throwing errors

Ping?

AaronNGray

comment created time in 6 days

PR opened akimd/bison

d: add support for lookahead correction

When using lookahead correction, the method YYParser.Context.getExpectedTokens is not annotated with const, because the method calls yylacCheck, which is not const. Also, because of yylacStack and yylacEstablished, yylacCheck needs to be called from the context of the parser class, which is sent as parameter to the Context's constructor.

  • data/skeletons/lalr1.d (yylacCheck, yylacEstablish, yylacDiscard, yylacStack, yylacEstablished): New. (Context): Use it.
  • doc/bison.texi: Document it.
  • tests/calc.at: Check it.
+229 -25

0 comment

3 changed files

pr created time in 7 days

PR opened akimd/bison

d: change the name of the custom error message function to reportSynt…

…axError

Changed from syntax_error to reportSyntaxError to be similar to the Java parser.

  • data/skeletons/lalr1.d: Change the function name.
  • doc/bison.texi: Document it.
  • tests/local.at: Adjust.
+5 -5

0 comment

3 changed files

pr created time in 7 days

push eventautotools-mirror/autoconf

Zack Weinberg

commit sha fd633e92cb63f7bb592dcffd2f2871fa28ab189d

AS_IF: Handle else clause being empty after macro expansion (#110369) AS_IF can emit a syntactically invalid shell if-then-else, if CONDITION then : # ... else fi when its IF-FALSE argument consists of macros that don’t produce any shell code. This was a documented limitation in AS_IF, but it’s a bad limitation to have, because macros that *used* to expand to shell commands might start expanding to nothing in future releases. For instance, this broke the libzmq configure script, which did AC_PROG_CC AX_CHECK_COMPILE_FLAG([-std=gnu11], [CFLAGS+=" -std=gnu11"], [AC_PROG_CC_C99]) Perfectly valid in 2.69, but in 2.70 AC_PROG_CC_C99 doesn’t produce any shell code and the script crashes. We had that limitation for good reason: we can’t just put ‘:’ at the beginning of the else-clause, like we do for the then-clause, because that would clobber $? and the IF-FALSE commands might want to inspect it. (This doesn’t matter for the then-clause, because $? is always zero at the beginning of a then-clause anyway.) The simplest and least inefficient shell construct I can find that works in this context is a shell function that does ‘return $?’. Due to awkward M4sh initialization ordering constraints (AS_IF gets used before we can safely use shell functions) an indirection through a shell variable is necessary. The structure of a m4sh script is now #! /bin/sh ## M4sh Initialization as_nop=: ... ## M4sh Shell Functions as_fn_nop () { return $?; } as_nop=as_fn_nop ... and AS_IF emits if CONDITION then : # ... else $as_nop # ... fi The uses of AS_IF that appear before the beginning of the M4sh Shell Functions section are all under our control and they don’t need to look at $?. If anyone has a better idea for how to make this work I will be glad to hear it. Fixes bug #110369. * lib/m4sugar/m4sh.m4 (_AS_IF_ELSE): When $1 is nonempty, invoke _AS_EMPTY_ELSE_PREPARE. Emit $as_nop at beginning of else clause. (_AS_BOURNE_COMPATIBLE): Initialize as_nop to ‘:’. (_AS_EMPTY_ELSE_PREPARE): New macro which emits a definition of as_fn_nop and resets as_nop to as_fn_nop. (AS_PREPARE, _AS_PREPARE): Invoke _AS_EMPTY_ELSE_PREPARE. (_AS_UNSET_PREPARE): Tweak white space. * tests/m4sh.at (AS_IF and AS_CASE): Test AS_IF’s IF-FALSE argument being empty after macro expansion. * doc/autoconf.texi (AS_IF): Remove warning about use with ‘run-if-false’ argument empty after macro expansion.

view details

Zack Weinberg

commit sha 15acc26a209accd353f5961487dfef3a03e12b4a

Don’t issue obsoletion warnings for AC_LANG_SAVE/RESTORE (#110375) The most recently released version of libtool.m4 is five years old as of this commit, and no new release is likely to appear anytime soon. It uses AC_LANG_SAVE and AC_LANG_RESTORE, in a way that doesn’t obviously translate to AC_LANG_PUSH and AC_LANG_POP. This will need to be fixed by libtool upstream. Until that actually happens, disable the -Wobsolete warnings for AC_LANG_SAVE and AC_LANG_RESTORE. (They are still documented as obsolete in the manual, as they have been for many years.) Fixes bug #110375. * lib/autoconf/lang.m4 (AC_LANG_SAVE, AC_LANG_RESTORE): Define with AC_DEFUN, not AU_DEFUN; remove manual -Wobsolete warnings.

view details

Zack Weinberg

commit sha b7e32b4dc746ea867ed68f41d767178b34cc43a0

AS_ECHO(_N): Do not expand macros named ‘s’ or ‘n’ (#110377) AS_ECHO expands to ‘printf "%s\n" $1’. If a configure script defines an M4 macro named ‘s’ or ‘n’ it will be expanded in the first argument to printf, which is almost certainly not what was intended. The configure script for ruby 2.7.2 uses ‘AS_VAR_PUSHDEF([s], ...)’ and breaks with 2.69d because of this. Add some extra quoting so that the ‘%s\n’ is treated as literal; similarly for AS_ECHO_N and the legacy shell variables $as_echo and $as_echo_n. For now, anyway, don’t quote the word ‘printf’; if someone does define that as a M4 macro they might well mean to affect AS_ECHO. (Whether this is something we *want* to allow, we can worry about when it comes up.) Fixes bug #110377. * lib/m4sugar/m4sh.m4 (_AS_ECHO_N_PREPARE, AS_ECHO, AS_ECHO_N): Add another layer of quoting around the first argument to printf. * tests/m4sh.at (Redefining AS_ECHO internals): New test.

view details

Zack Weinberg

commit sha 3b8f293ec21062c55fe2835be6c8af7d58dfe0af

AC_INIT: better handling of unusual arguments (#110349) Fix some subtle quotation bugs in _AC_INIT_PACKAGE that made it impossible to put ‘,’ or an unbalanced close parenthesis in some of the arguments to AC_INIT. Document that arguments to AC_INIT containing parentheses, square brackets, ‘,’ or ‘#’ may need to be double-quoted. Provide more detailed examples and exposition re computing the arguments to AC_INIT when autoconf is run (e.g. with git-version-gen). Add a whole bunch more tests for unusual arguments to AC_INIT, and a test that the backward-compatibility behavior of AC_INIT with only one argument is still correct. This may still break some of the existing configure scripts described in the threads at https://lists.gnu.org/r/autoconf/2020-10/msg00013.html and https://lists.gnu.org/r/bug-autoconf/2020-10/msg00012.html but, I hope, only in ways covered by the existing warning in NEWS about pickier M4 quotation. * lib/autoconf/general.m4 (_AC_INIT_PACKAGE): Redo argument normalization and default value selection in a simpler, less error-prone fashion. (_AC_INIT_PACKAGE_N): New helper subroutine. (AC_INIT): Always call _AC_INIT_PACKAGE, but supply no arguments if we were called with only one argument. * tests/base.at (AC_INIT (obsolete invocation)): New test. (AC_INIT with unusual version strings): Expand test. * doc/autoconf.texi (AC_INIT): Revise.

view details

push time in 8 days

issue commentakimd/bison

publish bison version number in generated output

Thanks a lot.

bazsi

comment created time in 10 days

issue closedakimd/bison

publish bison version number in generated output

I was trying to migrate from %name-prefix to api.prefix while trying to support the as-of-today versions of bison in various distributions.

I ran into one issue, which I have created a workaround for, but since this was pain to fix, let me suggest some additions to the generated grammar file. The suggestion is to publish

YYBISON_VERSION_MAJOR 3 YYBISON_VERSION_MINOR 5

macros, containing the major/minor version numbers. These would be in addition to the already existing YYBISON_VERSION macro.

Rationale:

YYBISON_VERSION as of today is a string representation of the bison version number, thus it does not allow me to create conditional code blocks in my grammar, which I needed in order to resolve a compatibility issue.

The issue I had was:

  • I am using YYEMPTY identifier in my rules, which in bison 3.5.1 was named YYEMPTY even if I used api.prefix.
  • starting with 3.6.1, YYEMPTY got renamed to <PREFIX>_EMPTY when api.prefix is used
  • to make my grammar work with all bison versions, I #defined <PREFIX>_EMPTY to YYEMPTY in case I was using 3.5.1

In order to have the version used to generate the .c file, I needed some sed magic in my Makefile rules to insert this information.

.y.c:
        $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
        $(AM_V_GEN) sed -i -e '1i #define SYSLOG_NG_BISON_MAJOR @bison_version_major@\n#define SYSLOG_NG_BISON_MINOR @bison_version_minor@'  $@

Here's the code in the upstream codebase I needed: https://github.com/syslog-ng/syslog-ng/blob/059c1154ab87833bfb2598600c20ede4f09a8aaf/lib/rewrite/rewrite-expr-grammar.ym#L48-L55

Just in case you are interested, the migration from the old style to the new one took us almost 2 years, as documented in this pull request: https://github.com/syslog-ng/syslog-ng/pull/2526

closed time in 10 days

bazsi

issue commentakimd/bison

publish bison version number in generated output

Bison 3.7.4 was released with that patch. Cheers!

bazsi

comment created time in 10 days

push eventakimd/bison

Todd C. Miller

commit sha c47bb87f9f1285309377adee7bb21263decc503c

yacc.c: fix #definition of YYEMPTY When generating a C parser, YYEMPTY is present in enum yytokentype but there is no corresponding #define like there is for the other values. There is a special case for YYEMPTY in b4_token_enums but no corresponding case in b4_token_defines. * data/skeletons/c.m4 (b4_token_defines): Do define YYEMPTY.

view details

Akim Demaille

commit sha 14c65a35f085acf2ae62bec29208f8de33aad66d

%require: accept version numbers with three parts ("3.7.4") * src/parse-gram.y (str_to_version): Support three parts. * data/skeletons/location.cc, data/skeletons/stack.hh: Adjust.

view details

Akim Demaille

commit sha d8b49e2b7360aa805297e110e9adb4c0b7f2f956

style: make conversion of version string to int public * src/parse-gram.y (str_to_version): Rename as/move to... * src/strversion.h, src/strversion.c (strversion_to_int): these new files.

view details

Akim Demaille

commit sha d3c575a6c6639a129d5ca84b60cc693fbd0cde68

regen

view details

Akim Demaille

commit sha 21c147b6e5372563b7c4741deadaddb9354f4b09

yacc.c: provide the Bison version as an integral macro Suggested by Balazs Scheidler. https://github.com/akimd/bison/issues/55 * src/muscle-tab.c (muscle_init): Move/rename `b4_version` to/as... * src/output.c (prepare): `b4_version_string`. Also define `b4_version`. * data/skeletons/bison.m4, data/skeletons/c.m4, data/skeletons/d.m4, * data/skeletons/java.m4: Adjust. * doc/bison.texi: Document it.

view details

Akim Demaille

commit sha fe8c36ddcafdb6b49059fb023970cca8d2ca589a

c++: style: follow the Bison m4 quoting pattern * data/skeletons/variant.hh: here.

view details

Akim Demaille

commit sha f4431ea11541ebb6a0f4d6cec8f120bd0639dd4a

c++: don't use YY_ASSERT at all if parse.assert is disabled In some extreme situations (about 800 tokens), we generate a single-line assertion long enough for Visual C++ to discard the end of the line, thus falling into parse ends for the missing `);`. On a shorter example: YY_ASSERT (tok == token::TOK_YYEOF || tok == token::TOK_YYerror || tok == token::TOK_YYUNDEF || tok == token::TOK_ASSIGN || tok == token::TOK_MINUS || tok == token::TOK_PLUS || tok == token::TOK_STAR || tok == token::TOK_SLASH || tok == token::TOK_LPAREN || tok == token::TOK_RPAREN); Whether NDEBUG is used or not is irrelevant, the parser dies anyway. Reported by Jot Dot <jotdot@shaw.ca>. https://lists.gnu.org/r/bug-bison/2020-11/msg00002.html We should avoid emitting lines so long. We probably should also use a range-based assertion (with extraneous parens to pacify fascist compilers): YY_ASSERT ((token::TOK_YYEOF <= tok && tok <= token::TOK_YYUNDEF) || (token::TOK_ASSIGN <= tok && ...) But anyway, we should simply not emit this assertion at all when not asked for. * data/skeletons/variant.hh: Do not define, nor use, YY_ASSERT when it is not enabled.

view details

Akim Demaille

commit sha 8b424b865e7fc1932131beff5298dfde0623ce28

lalr1.cc: YY_ASSERT should use api.prefix Working on the previous commit I realized that YY_ASSERT was used in the generated headers, so must follow api.prefix to avoid clashes when multiple C++ parser with variants are used. Actually many more macros should obey api.prefix (YY_CPLUSPLUS, YY_COPY, etc.). There was no complaint so far, so it's not urgent enough for 3.7.4, but it should be addressed in 3.8. * data/skeletons/variant.hh (b4_assert): New. Use it. * tests/local.at (AT_YYLEX_RETURN): Fix. * tests/headers.at: Make sure variant-based C++ parsers are checked too. This test did find that YY_ASSERT escaped renaming (before the fix in this commit).

view details

Akim Demaille

commit sha 0264b4bca071cfac10a8909f30e0e5aa422b35d6

c++: don't glue functions together * data/skeletons/bison.m4 (b4_type_foreach): Accept a separator. * data/skeletons/c++.m4: Use it. And fix an incorrect comment.

view details

Akim Demaille

commit sha d8cc6b073e2802d871a16dc62418a7eb62ed2216

c++: shorten the assertions that check whether tokens are correct Before: YY_ASSERT (tok == token::YYEOF || tok == token::YYerror || tok == token::YYUNDEF || tok == 120 || tok == 49 || tok == 50 || tok == 51 || tok == 52 || tok == 53 || tok == 54 || tok == 55 || tok == 56 || tok == 57 || tok == 97 || tok == 98); After: YY_ASSERT (tok == token::YYEOF || (token::YYerror <= tok && tok <= token::YYUNDEF) || tok == 120 || (49 <= tok && tok <= 57) || (97 <= tok && tok <= 98)); Clauses are now also wrapped on several lines. This is nicer to read and diff, but also avoids pushing Visual C++ to its arbitrary limits (640K and lines of 16380 bytes ought to be enough for anybody, otherwise make an C2026 error). The useless parens are there for the dummy warnings about precedence (in the future, will we also have to put parens in `1+2*3`?). * data/skeletons/variant.hh (_b4_filter_tokens, b4_tok_in, b4_tok_in): New. (_b4_token_constructor_define): Use them.

view details

Akim Demaille

commit sha 7a11a9308cb00e1301aaae95fff4a23867957039

version 3.7.4 * NEWS: Record release date.

view details

Akim Demaille

commit sha 0364dbacbf7b2e7e4c6655f706395a2eadd5f54e

maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.

view details

push time in 10 days

created tagakimd/bison

tagv3.7.4

GNU Bison

created time in 10 days

push eventakimd/bison

Nick Gasson

commit sha 7c6e7bd300fc71c35b81592f9854abe87ffc9cdf

doc: minor grammar fixes in counterexamples section * doc/bison.texi: Minor fixes in counterexamples section.

view details

Akim Demaille

commit sha bd6b046ce7ffd6cc5f7c1c77e425c97df66cd329

doc: fix incorrect section title Reported by Gaurav Singh <gaurav.singh199709@yahoo.com>. https://lists.gnu.org/r/bug-bison/2020-11/msg00000.html * doc/bison.texi (Rpcalc Expr): Rename as... (Rpcalc Exp): this, as the nterm is named 'exp'.

view details

Akim Demaille

commit sha 7cc9107053bb3c7f657941d7d0d276688505e082

style: enforce java coding style * tests/scanner.at: here.

view details

Akim Demaille

commit sha 98c35e0025f43838d4c451553a4cf8b345b047f8

gnulib: update

view details

Todd C. Miller

commit sha c47bb87f9f1285309377adee7bb21263decc503c

yacc.c: fix #definition of YYEMPTY When generating a C parser, YYEMPTY is present in enum yytokentype but there is no corresponding #define like there is for the other values. There is a special case for YYEMPTY in b4_token_enums but no corresponding case in b4_token_defines. * data/skeletons/c.m4 (b4_token_defines): Do define YYEMPTY.

view details

Akim Demaille

commit sha 14c65a35f085acf2ae62bec29208f8de33aad66d

%require: accept version numbers with three parts ("3.7.4") * src/parse-gram.y (str_to_version): Support three parts. * data/skeletons/location.cc, data/skeletons/stack.hh: Adjust.

view details

Akim Demaille

commit sha d8b49e2b7360aa805297e110e9adb4c0b7f2f956

style: make conversion of version string to int public * src/parse-gram.y (str_to_version): Rename as/move to... * src/strversion.h, src/strversion.c (strversion_to_int): these new files.

view details

Akim Demaille

commit sha d3c575a6c6639a129d5ca84b60cc693fbd0cde68

regen

view details

Akim Demaille

commit sha 21c147b6e5372563b7c4741deadaddb9354f4b09

yacc.c: provide the Bison version as an integral macro Suggested by Balazs Scheidler. https://github.com/akimd/bison/issues/55 * src/muscle-tab.c (muscle_init): Move/rename `b4_version` to/as... * src/output.c (prepare): `b4_version_string`. Also define `b4_version`. * data/skeletons/bison.m4, data/skeletons/c.m4, data/skeletons/d.m4, * data/skeletons/java.m4: Adjust. * doc/bison.texi: Document it.

view details

Akim Demaille

commit sha d0ea78ca4750f7eb751b1f7625c5580714cd4d47

todo: more

view details

Akim Demaille

commit sha fe8c36ddcafdb6b49059fb023970cca8d2ca589a

c++: style: follow the Bison m4 quoting pattern * data/skeletons/variant.hh: here.

view details

Akim Demaille

commit sha f4431ea11541ebb6a0f4d6cec8f120bd0639dd4a

c++: don't use YY_ASSERT at all if parse.assert is disabled In some extreme situations (about 800 tokens), we generate a single-line assertion long enough for Visual C++ to discard the end of the line, thus falling into parse ends for the missing `);`. On a shorter example: YY_ASSERT (tok == token::TOK_YYEOF || tok == token::TOK_YYerror || tok == token::TOK_YYUNDEF || tok == token::TOK_ASSIGN || tok == token::TOK_MINUS || tok == token::TOK_PLUS || tok == token::TOK_STAR || tok == token::TOK_SLASH || tok == token::TOK_LPAREN || tok == token::TOK_RPAREN); Whether NDEBUG is used or not is irrelevant, the parser dies anyway. Reported by Jot Dot <jotdot@shaw.ca>. https://lists.gnu.org/r/bug-bison/2020-11/msg00002.html We should avoid emitting lines so long. We probably should also use a range-based assertion (with extraneous parens to pacify fascist compilers): YY_ASSERT ((token::TOK_YYEOF <= tok && tok <= token::TOK_YYUNDEF) || (token::TOK_ASSIGN <= tok && ...) But anyway, we should simply not emit this assertion at all when not asked for. * data/skeletons/variant.hh: Do not define, nor use, YY_ASSERT when it is not enabled.

view details

Akim Demaille

commit sha 8b424b865e7fc1932131beff5298dfde0623ce28

lalr1.cc: YY_ASSERT should use api.prefix Working on the previous commit I realized that YY_ASSERT was used in the generated headers, so must follow api.prefix to avoid clashes when multiple C++ parser with variants are used. Actually many more macros should obey api.prefix (YY_CPLUSPLUS, YY_COPY, etc.). There was no complaint so far, so it's not urgent enough for 3.7.4, but it should be addressed in 3.8. * data/skeletons/variant.hh (b4_assert): New. Use it. * tests/local.at (AT_YYLEX_RETURN): Fix. * tests/headers.at: Make sure variant-based C++ parsers are checked too. This test did find that YY_ASSERT escaped renaming (before the fix in this commit).

view details

Akim Demaille

commit sha 0264b4bca071cfac10a8909f30e0e5aa422b35d6

c++: don't glue functions together * data/skeletons/bison.m4 (b4_type_foreach): Accept a separator. * data/skeletons/c++.m4: Use it. And fix an incorrect comment.

view details

Akim Demaille

commit sha d8cc6b073e2802d871a16dc62418a7eb62ed2216

c++: shorten the assertions that check whether tokens are correct Before: YY_ASSERT (tok == token::YYEOF || tok == token::YYerror || tok == token::YYUNDEF || tok == 120 || tok == 49 || tok == 50 || tok == 51 || tok == 52 || tok == 53 || tok == 54 || tok == 55 || tok == 56 || tok == 57 || tok == 97 || tok == 98); After: YY_ASSERT (tok == token::YYEOF || (token::YYerror <= tok && tok <= token::YYUNDEF) || tok == 120 || (49 <= tok && tok <= 57) || (97 <= tok && tok <= 98)); Clauses are now also wrapped on several lines. This is nicer to read and diff, but also avoids pushing Visual C++ to its arbitrary limits (640K and lines of 16380 bytes ought to be enough for anybody, otherwise make an C2026 error). The useless parens are there for the dummy warnings about precedence (in the future, will we also have to put parens in `1+2*3`?). * data/skeletons/variant.hh (_b4_filter_tokens, b4_tok_in, b4_tok_in): New. (_b4_token_constructor_define): Use them.

view details

Akim Demaille

commit sha 23472033ee5d28a7f3c245a9aea3e1abfdf379b5

Merge branch 'maint' * maint: c++: shorten the assertions that check whether tokens are correct c++: don't glue functions together lalr1.cc: YY_ASSERT should use api.prefix c++: don't use YY_ASSERT at all if parse.assert is disabled c++: style: follow the Bison m4 quoting pattern yacc.c: provide the Bison version as an integral macro regen style: make conversion of version string to int public %require: accept version numbers with three parts ("3.7.4") yacc.c: fix #definition of YYEMPTY gnulib: update doc: fix incorrect section title doc: minor grammar fixes in counterexamples section

view details

Akim Demaille

commit sha b9b13602ed396ffad63b3bd054234263af73618c

style: prefer b4_symbol(empty, ...) to b4_symbol(-2, ...) * data/skeletons/c.m4: here.

view details

Akim Demaille

commit sha 7a11a9308cb00e1301aaae95fff4a23867957039

version 3.7.4 * NEWS: Record release date.

view details

Akim Demaille

commit sha 0364dbacbf7b2e7e4c6655f706395a2eadd5f54e

maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.

view details

Akim Demaille

commit sha 5945da031ee9389e3cf14833b1493cbc5000ec01

Merge branch 'maint' * upstream/maint: maint: post-release administrivia version 3.7.4

view details

push time in 10 days

push eventakimd/bison

Akim Demaille

commit sha 23472033ee5d28a7f3c245a9aea3e1abfdf379b5

Merge branch 'maint' * maint: c++: shorten the assertions that check whether tokens are correct c++: don't glue functions together lalr1.cc: YY_ASSERT should use api.prefix c++: don't use YY_ASSERT at all if parse.assert is disabled c++: style: follow the Bison m4 quoting pattern yacc.c: provide the Bison version as an integral macro regen style: make conversion of version string to int public %require: accept version numbers with three parts ("3.7.4") yacc.c: fix #definition of YYEMPTY gnulib: update doc: fix incorrect section title doc: minor grammar fixes in counterexamples section

view details

Akim Demaille

commit sha b9b13602ed396ffad63b3bd054234263af73618c

style: prefer b4_symbol(empty, ...) to b4_symbol(-2, ...) * data/skeletons/c.m4: here.

view details

push time in 11 days

push eventakimd/bison

Valentin Tolmer

commit sha ef09bf065ae2e3d67bf072b35e7fc3e779733087

glr2.cc: fork glr.cc to a c++ version This is a fork of glr.cc to be c++-first instead of a wrapper around glr.c. * data/skeletons/glr2.cc: New. * data/skeletons/bison.m4, data/skeletons/c++.m4: Adjust. * data/skeletons/c.m4 (b4_user_args_no_comma): New. * src/reader.c (grammar_rule_check_and_complete): glr2.cc is C++. * tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at, * tests/input.at, tests/local.at, tests/regression.at, tests/scanner.at, * tests/synclines.at, tests/types.at: Also check glr2.cc.

view details

Akim Demaille

commit sha b63e3a3352ea13074c5491e40f92b40ce0552004

glr2.cc: fix a few warnings * data/skeletons/glr2.cc: Fix some documentation. Be consistent between class/struct. (yydoAction, yyresolveAction): Avoid passing yyparser where useless.

view details

Akim Demaille

commit sha 115a947f0877f935f4fa7123cb57225686608261

tests: beware of sed portability issues Reported by David Laxer <davidl@softintel.com>. https://lists.gnu.org/r/bug-bison/2020-08/msg00027.html * tests/output.at: Don't use + with sed. While at it, fix a quotation problem hidden by the use of '#'.

view details

Akim Demaille

commit sha 2becdace960a1d93095a7ae015c16d69757f29f8

gnulib: update

view details

Akim Demaille

commit sha 3c36d871fad4d9d762f8daf0537ff28803f18397

cex: display the rule numbers From Example: "if" expr "then" "if" expr "then" stmt • "else" stmt Shift derivation if_stmt ↳ "if" expr "then" stmt ↳ if_stmt ↳ "if" expr "then" stmt • "else" stmt Reduce derivation if_stmt ↳ "if" expr "then" stmt "else" stmt ↳ if_stmt ↳ "if" expr "then" stmt • to Example: "if" expr "then" "if" expr "then" stmt • "else" stmt Shift derivation if_stmt ↳ 3: "if" expr "then" stmt ↳ 2: if_stmt ↳ 4: "if" expr "then" stmt • "else" stmt Example: "if" expr "then" "if" expr "then" stmt • "else" stmt Reduce derivation if_stmt ↳ 4: "if" expr "then" stmt "else" stmt ↳ 2: if_stmt ↳ 3: "if" expr "then" stmt • * src/state-item.h, src/state-item.c (state_item_rule): New. * src/derivation.h, src/derivation.c (struct derivation): Add a rule member. Adjust dependencies. * src/counterexample.c, src/parse-simulation.c: Pass the rule to derivation_new. * src/derivation.c (fprintf_if): New. (derivation_width, derivation_print_tree_impl): Take the rule number into account. * tests/conflicts.at, tests/counterexample.at, tests/diagnostics.at, * tests/report.at: Adjust. * doc/bison.texi: Adjust.

view details

Akim Demaille

commit sha 82d913741bbebec4b8be974141801ce328920f67

glr2.cc: avoid warnings about long long * data/skeletons/glr2.cc: Disable the warning before triggering it.

view details

Akim Demaille

commit sha 325ec7d32414d3b732d22387bb54da6918ec2ffc

cex: always show ε/%empty in counterexamples On a case such as %% exp : empty "a" | "a" empty empty : %empty we used to display warning: shift/reduce conflict on token "a" [-Wcounterexamples] Example: • "a" Shift derivation exp ↳ 2: • "a" empty ↳ 2: ε Example: • "a" Reduce derivation exp ↳ 1: empty "a" ↳ 3: • where the shift derivation shows an item "2: empty → ε", with an explicit "ε", but the reduce derivation shows "3: empty → •", without "ε". For consistency, let's always show ε/%empty in rules with an empty rhs: Reduce derivation exp ↳ 1: empty "a" ↳ 3: ε • * src/derivation.c (derivation_width, derivation_print_tree_impl): Always show ε/%empty in counterexamples. * tests/diagnostics.at: Check that case. * tests/conflicts.at, tests/counterexample.at: Adjust.

view details

Adela Vais

commit sha f3bcb3de0e4bf9eb3e771857917e19aa271b4c30

examples: d: fix the handling of unary + It was interpreting "+exp" as "-exp". * examples/d/calc.y: Fix. * examples/d/calc.test: Check it.

view details

Adela Vais

commit sha 8032dde38397c05777b45c5f3d41637724c7d599

examples: d: duplicate the example as "simple" and "calc" * examples/d/Makefile, examples/d/calc.d, examples/d/calc.test, examples/d/calc/local.mk: Move into... * examples/d/calc, examples/d/simple: these new directories.

view details

Adela Vais

commit sha 6e1d83c8a8d6f6af81ad948c9312d8964043284e

examples: d: demonstrate location tracking * examples/d/calc/calc.y: Track locations. * examples/d/calc/calc.test: Check locations.

view details

Valentin Tolmer

commit sha 38abe1e1b7d1dea2aa59de63695fd8c0d8686205

glr2.cc: avoid warnings about printf and shadowing * data/skeletons/glr2.cc: Migrate from using printf to std::cerr & co. Since the yyGLRStack has the user params, no need to pass them around.

view details

Akim Demaille

commit sha f3f7f6e1dca60cae09146f0a6439477a055567e1

glr2.cc: get rid of the yyerror scaffolding The yyerror stand-alone function was used to bounce from glr.c's call to yyerror to glr.cc's parser.error. Now that glr.c is out of the way, just directly use parser.error. * data/skeletons/glr2.cc (yyerror): Remove. Adjust callers. (b4_yyerror_args, b4_lyyerror_args, b4_pure_formals): Remove. Now unused.

view details

Akim Demaille

commit sha 1df4b746da8d35e5e1ec2edbd707ca755f91d42d

glr2.cc: style changes * data/skeletons/glr2.cc: Remove stray comment.

view details

Akim Demaille

commit sha 0d8407440c6514795e1fc055062002b731c5f209

doc: simplify the extraction of example snippets * doc/bison.texi: Use qualified paths. * examples/extexi: Comment changes.

view details

Akim Demaille

commit sha 5d711972b881f8fa79a8ba4605a39a0d0bf4d9e4

Merge branch 'maint' (i.e., Bison 3.7.2) * upstream/maint: maint: post-release administrivia version 3.7.2 build: disable syntax-check warning gnulib: update build: fix incorrect dependencies doc: updates gnulib: update tests: beware of sed portability issues

view details

Akim Demaille

commit sha 93d6a5ba4df9ccc0935ef2c8bc892c02c8c1540d

examples: d: remove unused token * examples/d/calc/calc.y, examples/d/simple/calc.y: Remove "=".

view details

Valentin Tolmer

commit sha b7e2cac2aaee433415209ac65092425164eccd76

glr2.cc: add copy constructor to yyGLRStackItem This silences the clang warning -Wdeprecated-copy. * data/skeletons/glr2.cc: here.

view details

Valentin Tolmer

commit sha 1c5b05ad31f9a1572a370c42b827e2a8bd641736

glr2.cc: remove C-style casts * data/skeletons/glr2.cc: here.

view details

Valentin Tolmer

commit sha 8bfc319f8e6a2024349179fb262a0a68760ba61e

glr2.cc: remove usage of PTRDIFF_MAX * data/skeletons/glr2.cc: Use std::ptrdiff_t and numeric_limits.

view details

Valentin Tolmer

commit sha cf8723de0d05d0a1c9ea1711e3cff3130f5f5403

glr2.cc: move StrongIndexAlias into the namespace * data/skeletons/glr2.cc: here.

view details

push time in 11 days

issue commentakimd/bison

publish bison version number in generated output

You are right. I just always used hex numbers for this purpose, but the ifdef in your example makes sense. So I am okay with using this as is.

bazsi

comment created time in 12 days

PR opened akimd/bison

glr2.cc: fix a memory corruption bug

Plus misc cleanups.

+178 -155

0 comment

3 changed files

pr created time in 13 days

issue commentakimd/bison

publish bison version number in generated output

I would use a hexadecimal number so the major/minor/patch values can be extracted.

I fail to see how decimal and hexadecimal would differ here.

And I think this should be 0x030703 instead.

Care to argument?

#define YYBISON_VERSION_MAJOR ((YYBISON >> 16) & 0xFF)
#define YYBISON_VERSION_MINOR ((YYBISON >> 8) & 0xFF)
#define YYBISON_VERSION_PATCH ((YYBISON) & 0xFF)

I don't see any value in these macros. What kind of condition do you think you need to write that would make sense with them? In my experience, simple numbers suffice and are way more easy to manipulate and understand.

Also, I think I would use a bit more specific name, like YYBISON_VERSION_VALUE

Well, __GNUC__ is the version of GCC, I don't see a problem with that. I would have happily used YYBISON_VERSION, but it's already taken for something else :-(

This is how this looks like in syslog-ng with the current name/decimal encoding:

#if YYBISON / 10000 == 3 && (YYBISON % 10000) / 100 <= 5

Why do you need to specify == 3? Most of the time conditions such as

#if 30704 <= YYBISON && YYBISON < 30800

suffice.

Cheers!

bazsi

comment created time in 13 days

push eventautotools-mirror/autoconf

Zack Weinberg

commit sha dbd374cff01a32210450faeee20f7d368c85de54

tests/compile.at (AC_RUN_IFELSE): typo fix

view details

Ross Burton

commit sha 996f608165814d578bdcb0ab2f3382edb8918690

Support CONFIG_SITE being a list of entries. Instead of treating CONFIG_SITE as a single path, treat it as a space-separated list of paths and load them in order. Also remove the special-casing of entries starting with a dash, this is redundant as they'll be caught by the wildcard case. Finally add a test case to verify that multiple files are loaded correctly. * lib/autoconf/general.m4 (AC_SITE_LOAD): Treat CONFIG_SITE as a space-separated list of scripts to be sourced. Simplify handling of default config.site locations using this capability. * tests/base.at (AC_CACHE_CHECK): Test loading of multiple site files. * doc/autoconf.texi (Site Defaults): Update documentation of CONFIG_SITE.

view details

push time in 13 days

push eventautotools-mirror/autoconf

Zack Weinberg

commit sha 4c59bf27d7083088290219450c81d999431b43f1

Improve handling of missing aux scripts. Another regression identified by the Debian archive rebuild was that more macros require the presence of config.sub and config.guess now. ‘autoreconf --install’ doesn’t install these itself, it relies on ‘automake --add-missing’ to do that; so, packages that don’t use Automake will fail at the configure stage after configure is regenerated. To make matters worse, AC_CONFIG_AUX_DIRS assumes that everyone who needs config.sub and config.guess also needs install-sh, so in about half of the affected packages, the failure manifested as a complaint about install-sh being missing -- technically true but adding install-sh wouldn’t have resolved the problem by itself. This patch overhauls the AC_CONFIG_AUX_DIR(S) mechanism so that a configure script knows the complete set of aux scripts that were AC_REQUIRE_AUX_FILE’d for it, checks for the existence of all of them, and not any others. Thus, this configure script AC_INIT([test], [1.0]) AC_FUNC_MALLOC AC_CONFIG_HEADERS([config.h]) AC_OUTPUT will work fine in a directory that contains config.sub and config.guess but not install-sh. Also, if it’s in a directory that *doesn’t* contain config.sub and config.guess, it will print an accurate error message configure: error: cannot find required auxiliary files: config.guess config.sub instead of the misleading configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.." A side-effect: it doesn’t make sense for AC_CONFIG_SUBDIRS to demand the presence of Cygnus configure in the aux dir, on the off-chance that one of the subdirectories *might* be using it -- I have no idea where someone would even get a copy of that nowadays -- so I dropped that feature. I rather suspect nobody has needed it in over a decade. I also documented the expanded need for config.sub and config.guess in NEWS as well as the manual. * NEWS: Document expanded need for config.sub and config.guess. Document removed support for Cygnus configure in subdirectories. * doc/autoconf.texi: Clarify exactly when install-sh, config.sub, and/or config.guess are required. Document canonical online sources for these scripts. Revise documentation of AC_CONFIG_AUX_DIR and AC_REQUIRE_AUX_FILE. Minor improvements to documentation of AC_CONFIG_SRCDIR. Remove mentions of Cygnus configure in subdirectories. * lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Remove mention of Cygnus configure; clarify function of configure.gnu. (AC_CONFIG_AUX_DIR): Support multiple invocations. (AC_CONFIG_AUX_DIRS): Now an undocumented compatibility interface rather than an internal subroutine; just runs AC_CONFIG_AUX_DIR on each of its arguments. (AC_CONFIG_AUX_DIR_DEFAULT): Now a backward compatibility stub that requires _AC_INIT_AUX_DIR without adding anything to _AC_AUX_FILES. (AC_REQUIRE_AUX_FILE): Now adds the named aux file to _AC_AUX_FILES and requires _AC_INIT_AUX_DIR, as well as being a trace hook. (_AC_INIT_AUX_DIR): New home of the loop searching for necessary aux files (formerly in AC_CONFIG_AUX_DIRS). Looks for all the necessary aux files, not just for install-sh. (ac_config_guess, ac_config_sub, ac_configure): Issue deprecation warnings if these undocumented shell variables are actually used. (AC_CANONICAL_BUILD, AC_CANONICAL_HOST, AC_CANONICAL_TARGET): No need to require AC_CONFIG_AUX_DIR_DEFAULT. Can rely on $ac_aux_dir ending with a slash. * lib/autoconf/programs.m4 (AC_PROG_INSTALL, AC_PROG_MKDIR_P): No need to require AC_CONFIG_AUX_DIR_DEFAULT. * lib/autoconf/status.m4 (_AC_CONFIG_SUBDIRS): No need to require AC_CONFIG_AUX_DIR_DEFAULT. Remove check for Cygnus configure; clarify function of configure.gnu. * lib/autotest/general.m4: Remove mention of Cygnus configure. * tests/torture.at (Missing auxiliary files): New test.

view details

Zack Weinberg

commit sha 35a1c64600894ecc3b06b6c4b273952db7c8fc83

Improve handling of missing aux scripts (autoreconf) Make ‘autoreconf --install’ add config.sub, config.guess, and install-sh to the source tree when necessary. This is only relevant for packages that don’t use Automake, because ‘automake --add-missing’ already adds these scripts to the source tree, but apparently there are plenty of packages out there that don’t use Automake, didn’t need config.{sub,guess} with autoconf 2.69, and do need them with 2.70. Such packages will need to have their equivalent of ‘make dist’ manually updated to ship the new files, of course. This patch also has ‘autoreconf’ issue an error if aux files are missing and ‘--install’ *wasn’t* used, or if --install *was* used but could not install all the missing files. This error is more likely to be caught by maintainers than the configure-time error added in the previous patch. It is not currently practical to make autoconf itself issue this error message, because of how the autoconf wrapper script is different from all the other wrapper scripts. Also, autoreconf runs automake *after* autoconf, so we’d get spurious errors from packages that do use automake. * bin/autoreconf.in ($buildauxdir): New package global, initialized to $pkgdatadir/build-aux, or to $ENV{autom4te_buildauxdir} if that’s set. (find_missing_aux_files, can_install_aux_files, try_install_aux_files) (install_aux_file, make_executable): New subs. (autoreconf_current_directory): Trace AC_REQUIRE_AUX_FILE. After running all tools that might install aux files, try to install aux files ourself if --install was given. After that, report on any that are still missing. * lib/autom4te.in (Autoreconf-preselections): Add AC_REQUIRE_AUX_FILE. Make list order consistent with list order in autoreconf.in. * tests/wrapper.as: Set autom4te_buildauxdir to point to location of config.guess, config.sub, and install-sh within the source tree. * lib/local.mk: Install config.guess, config.sub, and install-sh into $(pkgdatadir)/build-aux. * doc/autoconf.texi: Document that autoreconf can now install config.guess, config.sub, and install-sh itself without help from automake, but packages not using automake will need to arrange for tarball distribution of these files by hand. * tests/torture.at (Missing auxiliary files): Test autoreconf as well.

view details

Jannick

commit sha 7b7a4f9ccd9c0583fcfc928b62ba5ab28cfbd68c

Treat msys(2) the same as cygwin when looking at host_os. In most cases, checks depending on the value of $host_os should treat *-*-cygwin*, *-*-msys*, and *-*-mingw* all the same. * lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS): Discard -lkernel32 on msys* as well. When not discarding -lkernel32, deduplicate it, like other -l options. * lib/autoconf/functions.m4 (AC_FUNC_MALLOC, AC_FUNC_REALLOC): msys* also guarantee to return nonnull for malloc(0)/realloc(0). * tests/local.at (at_check_env): Also ignore MSYS as an environment variable.

view details

Zack Weinberg

commit sha 5147a642966e2247827cfd9e6f71464439c6d773

tests/m4sh.at: prevent an undesirable expansion of __oline__. The descriptive comment for AT_DATA_LINENO mentions __oline__, and this is expanded when generating the testsuite, which is confusing to anyone reading the generated testuite. Defang it with @&t@. * tests/m4sh.at (AT_DATA_LINENO): Prevent expansion of __oline__ in the descriptive comment.

view details

Zack Weinberg

commit sha bf19f95cf4766c8a22583dfdbbbbc67a97c4b6b0

Ignore stderr when testing parallel autotest (#110351). Non-release versions of bash (notably 5.1.0(1)-rc1, which was uploaded to Debian unstable) print internal debugging messages like TRACE: pid 411364: bgp_delete: deleting 432074 to the test driver’s stderr while executing the parallel test driver. This causes spurious failures in the test suite. Chet Ramsey assures me these are not a symptom of a bug in either bash or the driver code (see https://lists.gnu.org/archive/html/bug-autoconf/2020-10/msg00047.html) so have the test suite ignore them. This fixes Savannah bug #110351. * tests/autotest.at: Ignore stderr whenever running a micro-suite in parallel mode, to avoid spurious failures due to internal debugging messages that may be printed by bash.

view details

Zack Weinberg

commit sha 33c3a47c04ab70a4dd54963fe433a171bc03747f

Don’t search for X11 when cross compiling (#110345) This is undesirable because X11 development headers and libraries found by searching /usr are much more likely to belong to the build operating system than the host operating system (being cross-compiled for). A particularly problematic case, from the original bug report, is “using a sysroot where the target is binary compatible with the host. In this case AC_PATH_X will happily look at /usr and say that yes, X is available, even if the sysroot doesn't have X.” To cross-compile X client applications, the recommended procedure is to put X11 headers and libraries for the host system in the cross compiler’s default search path; alternatively, --x-includes and --x-libraries can be used. Fixes bug #110345. Problem reported by Ross Burton. * lib/autoconf/libs.m4 (_AC_PATH_X): Before doing anything else, see whether a test compilation with no special options (just -lX11) will work. If it doesn’t, only invoke _AC_PATH_X_XMKMF and _AC_PATH_X_DIRECT when not cross compiling.

view details

Zack Weinberg

commit sha d6fa54586d7989365cfc135bdb3ba5f7c3585a7d

AC_LANG_CALL(C++): Use ‘int’ for return type of conftest::$2. Commit 326c9a547423d25c621bc5c0ef76edbf6eda8c92 introduced a custom AC_LANG_CALL for C++. Jani Välimaa reports in https://lists.gnu.org/archive/html/bug-autoconf/2020-10/msg00054.html that the new code does not handle AC_CHECK_LIB([foo], [main]) correctly. This is not the recommended way to use AC_CHECK_LIB, but it’s what you get if you autoupdate from AC_HAVE_LIBRARY, and some people may not have bothered replacing main with a more appropriate symbol. This patch changes the return type of the fake function declaration for AC_CHECK_LIB’s second argument to be ‘int’, which is sufficient to make g++ 10.2.0 happy again. We’re still on thin ice, unfortunately; the code generated by AC_LANG_CALL *always* has undefined behavior, in both C and C++, unless by chance the real prototype of the function we’re probing for happens to match our fake declaration. The only permanent cure is to stop faking declarations, and that’s going to be a challenge. * lib/autoconf/c.m4 (AC_LANG_CALL(C++)): Use ‘int’ for the return type of the fake function declaration, to avoid problems when the function whose declaration we’re faking is ‘main’.

view details

Zack Weinberg

commit sha 45f1c8ba95c84a2980aa2ed3d03f1674fcc114fa

testsuite: Isolate aclocal from third-party macros (#110352). Several tests in the testsuite run a system-provided aclocal, which will look into its $prefix/share/aclocal for third-party macros. If those macros are buggy, aclocal may bomb out even though the test doesn’t use them, causing the test to fail spuriously. In all tests that need to run aclocal, create an empty directory and give aclocal the --system-acdir option pointing at that directory. This masks out all these potentially buggy macros. (It does *not* mask out AM_INIT_AUTOMAKE, which aclocal will find in a different directory.) In all tests that run autoreconf but *don’t* need to run aclocal, create an empty aclocal.m4 and set ACLOCAL=true in the environment. Fixes bug #110352. Problem reported by Dagobert Michelsen. * tests/fortran.at * tests/tools.at * tests/torture.at: Set ACLOCAL=true in the environment in all tests that run autoreconf but don’t need to run aclocal. Set ACLOCAL="aclocal --system-acdir <empty directory>" in all tests that do need to run aclocal.

view details

Zack Weinberg

commit sha f1047b2e9656ba1cb3b672df22b2178ad0b38738

AC_OPENMP: Avoid clobbering ‘mp’ and/or ‘penmp’ (#110353) Some of the compiler options that AC_OPENMP tests, mean “enable OpenMP” to one compiler, but “write output to a file named ‘mp’ or ‘penmp’” to other compilers. The author of AC_OPENMP believed that this could only happen if compilation was *successful*, but didn’t realize that one of the options means “write *preprocessed* output to a file named ‘penmp’” to SunPRO C, and that this *would* succeed on the test program. (AC_LINK_IFELSE fails anyway, because the compilation didn’t create conftest$exeext.) The option that actually means “enable OpenMP” to SunPRO C is earlier in the list than the option that means “write preprocessed output to a file named ‘penmp’”, so we might never have noticed this, but for a second bug: if you have a bad combination of Solaris operating system patches installed, it’s possible for this compiler to successfully *compile* a program that uses OpenMP, but then fail to *link* it because the OpenMP runtime library is out of sync with the core C library. AC_OPENMP doesn’t distinguish this case from “that option doesn’t mean ‘enable OpenMP’” so it goes on to other entries in the list and hits the “write preprocessed output” one. Implement four layers of defensive measures against this mess: - Use an #error directive instead of a compile-time syntax error to halt compilation when _OPENMP is not defined. - For each option that might mean “enable OpenMP”, first do an AC_COMPILE_IFELSE to find out whether it really means that, and then an AC_LINK_IFELSE to find out whether it works. If the compilation succeeds but the link fails, bail out of the loop and declare OpenMP to be unsupported. - If a file named ‘mp’ or ‘openmp’ exists in configure’s working directory when AC_OPENMP begins, error out. This means it is safe to delete any file named ‘mp’ or ‘openmp’ that exists at the *end* of AC_OPENMP. - If a file named ‘mp’ or ‘openmp’ exists in the top level of the source tree with a configure.ac that uses AC_OPENMP, have autoconf error out, too. Fixes bug #110353. Problem reported by Dagobert Michelsen. * lib/autoconf/c.m4 (_AC_LANG_OPENMP(C)): Change ‘choke me’ to ‘#error "OpenMP not supported"’. (AC_OPENMP): AC_REQUIRE _AC_OPENMP_SAFE_WD. For each option, do both a compile test and a link test; if the compile test succeeds but the link fails, don’t go on to other candidate options. Delete files named ‘mp’ and ‘penmp’ after the loop. (_AC_OPENMP_SAFE_WD): New macro, subroutine of AC_OPENMP. If files named ‘mp’ or ‘penmp’ exist, error out both at autoconf time and at configure time. * tests/torture.at (Files clobbered by AC_OPENMP): New test. * doc/autoconf.texi: Document requirement not to have files named ‘mp’ or ‘penmp’ next to a configure.ac that uses AC_OPENMP.

view details

Zack Weinberg

commit sha 46f384f850b455cdb366bafbcf4e992606b3f2c0

Revert to 2.69-compatible behavior in AC_PROG_LEX (#110346) Commit 29ede6b96feee29c0c477d1659081bbdb82cd8b3 caused AC_PROG_LEX to stop looking for a library that provides yywrap. This broke several packages in a Debian archive rebuild. Revert all the way to the 2.69 behavior, which was to set LEXLIB to -ll or -lfl if that library defines yywrap, but allow AC_PROG_LEX to succeed if neither -ll nor -lfl exists on the system, even if a lex program that doesn't define yywrap would need it. (This behavior was a bug, but people have come to depend on it. See https://savannah.gnu.org/support/index.php?110269 and the thread starting from https://lists.gnu.org/r/autoconf-patches/2020-07/msg00013.html for gory details.) To provide a path away from bug-compatibility, AC_PROG_LEX now takes one argument, documented as a whitespace-separated list of options. Two options are defined: ‘yywrap’ means to look for yywrap and behave as if lex is unavailable if it isn’t found; ‘noyywrap’ means to not look for yywrap at all. These are mutually exclusive. Fixes bug #110346. * lib/autoconf/programs.m4 (AC_PROG_LEX): Add an argument which can be either ‘yywrap’, meaning to look for yywrap in -ll, or ‘noyywrap’, meaning to not look for yywrap at all. In the absence of either option, issue an obsoletion warning and revert to behavior bug-compatible with 2.69. * tests/semantics.at: Add more tests of AC_PROG_LEX. * tests/mktests.sh: Exclude AC_PROG_LEX from autogenerated tests. * doc/autoconf.texi: Update documentation of AC_PROG_LEX. * NEWS: Update notes on AC_PROG_LEX.

view details

Zack Weinberg

commit sha 73f1be5e42e37644e9e742e9995fac250a9b3f25

autoreconf.in: improve compatibility with old perl In very old perls (I noticed this with 5.8.4), File::Temp objects are not automatically stringified in all contexts where we expect them to be, causing autoreconf to crash. * bin/autoreconf.in (install_aux_file): Explicitly extract the temporary file’s name from $temp, and use that in all the places we were using $temp.

view details

Jannick

commit sha 15ada9d3a0e46c28c0a3af2357b64bbd14d818a8

_AC_PROG_YYTEXT_DECL: Forward declare yywrap (#110312) Some versions of lex need you to forward-declare yywrap in a %{ %} block before the rules section, if you’re going to define it yourself. May help with bug #110312. * lib/autoconf/programs.m4 (_AC_PROG_LEX_YYTEXT_DECL): In the test input to lex, forward-declare yywrap before the rules.

view details

Zack Weinberg

commit sha 3b015c9f859db59b65bb9b7c711a32503725ccdb

fix ‘make syntax-check’ complaints (only affects comments).

view details

Zack Weinberg

commit sha 972e83200f3e015c8e531d9a416a944af588c85f

make fetch

view details

Zack Weinberg

commit sha aa27fc5707c6be8c921548d5a2c408f24a125a09

Define AC_REQUIRE_AUX_FILE with AC_DEFUN. Some widely used Automake recipes involve putting AC_REQUIRE_AUX_FILE at top level of a configure script, and it uses AC_REQUIRE now, so it needs to be defined with AC_DEFUN. * lib/autoconf/general.m4 (AC_REQUIRE_AUX_FILE): Define with AC_DEFUN. * tests/torture.at (Missing auxiliary files (foreign)): New test.

view details

Zack Weinberg

commit sha c8b3f6987a7bbfe15ce2c2f04f308a6abc263d04

AC_FUNC_STRERROR_R: Include string.h in test program. I misremembered how AC_LANG_PROGRAM works. We don’t need to invoke AC_INCLUDES_DEFAULT here but we *do* need to explicitly include string.h. Unfortunately we have no good way of testing for this regression with the testsuite as it is today. * lib/autoconf/functions.m4 (AC_FUNC_STRERROR_R): Include string.h in test program.

view details

Zack Weinberg

commit sha 0f7e5a5477f97b8a105d563bc7590ebefaff854d

Do not apply --program-transform-name to build-aux scripts. autoreconf expects to find $(pkgdatadir)/build-aux/config.sub etc under those names, not names modified by --program-transform-name. Placing them in $(pkgdatadir) is sufficient to keep parallel installations of autoconf separate: anyone doing that would need to adjust @PACKAGE@ anyway. * lib/local.mk: Use a _DATA rule, not a _SCRIPTS rule, to install config.guess, config.sub, and install-sh. (install-data-hook-make-aux-scripts-executable): New hook rule.

view details

Zack Weinberg

commit sha 8e5401395857f1acae558a5e926bad6609580fae

Make ‘forbidden tokens, basic’ test more robust. While testing the previous patch I noticed that the ‘forbidden tokens, basic’ test can fail if it runs too fast, because the autom4te cache files aren’t considered newer than configure.ac. * tests/tools.at (forbidden tokens, basic): Add delays to ensure autom4te.cache files are newer than configure.ac.

view details

Zack Weinberg

commit sha a8b69e68aa2c96ad8b93822e462719d59d69025a

Fix more bugs in specific tests under AC_LANG(C++). Found by exhaustive testing for differences between probe results under AC_LANG(C) and AC_LANG(C++). * lib/autoconf/c.m4 (AC_C_FLEXIBLE_ARRAY_MEMBER): Cast result of malloc for C++ compatibility. * lib/autoconf/programs.m4 (_AC_PROG_LEX_YYTEXT_DECL): Declare yywrap as extern "C" when compiling as C++.

view details

Michał Górny

commit sha 20a53df1adefa75f6175ffc8dc668f145cc06491

autoreconf: Support AM_GNU_GETTEXT_REQUIRE_VERSION As reported in https://github.com/gentoo/gentoo/pull/163, gettext 0.19.6 supports using AM_GNU_GETTEXT_REQUIRE_VERSION (specifying a *minimum* required version of gettext) instead of AM_GNU_GETTEXT_VERSION (which specifies a *fixed* required version of gettext). Update autoreconf to support both. * bin/autoreconf.in (autoreconf_current_directory): Check for AM_GNU_GETTEXT_REQUIRE_VERSION as well as AM_GNU_GETTEXT_VERSION. Update diagnostics about using AM_GNU_GETTEXT_VERSION but not AM_GNU_GETTEXT, or vice versa, to match. * doc/autoconf.texi (autoreconf Invocation): Update to match.

view details

push time in 13 days

issue commentakimd/bison

publish bison version number in generated output

I would use a hexadecimal number so the major/minor/patch values can be extracted.

This is what I see now:

/* Identify Bison output, and Bison version.  */
#define YYBISON 30703

And I think this should be 0x030703 instead. I was grepping through a number of header files how they usually encode this information and what I have found is that some of those do use decimal values, but in those cases I usually found the broken down version numbers in additional macros. So if we have a single VERSION value I would encode it as a hexadecimal value, so that these expressions would work:

#define YYBISON_VERSION_MAJOR ((YYBISON >> 16) & 0xFF) #define YYBISON_VERSION_MINOR ((YYBISON >> 8) & 0xFF) #define YYBISON_VERSION_PATCH ((YYBISON) & 0xFF)

Also, I think I would use a bit more specific name, like YYBISON_VERSION_VALUE

This is how this looks like in syslog-ng with the current name/decimal encoding:

#if YYBISON / 10000 == 3 && (YYBISON % 10000) / 100 <= 5

/* old bison versions (e.g. 3.5.1 and below) when using api.prefix, didn't
 * generate the PRAGMA_EMPTY enum, but had YYEMPTY, so let's define
 * PRAGMA_EMPTY to YYEMPTY, so the grammar itself is able to use the new
 * style */
#define PRAGMA_EMPTY YYEMPTY
#endif

Thanks.

On Wed, Nov 11, 2020 at 4:52 PM Akim Demaille notifications@github.com wrote:

Balazs, I intend to release 3.7.4 this weekend, but I would like to make sure it addresses your concerns. Could you please give a shot at:

https://www.lrde.epita.fr/~akim/private/bison/bison-3.7.3.15-f4e85.tar.gz https://www.lrde.epita.fr/~akim/private/bison/bison-3.7.3.15-f4e85.tar.lz https://www.lrde.epita.fr/~akim/private/bison/bison-3.7.3.15-f4e85.tar.xz

The YYBISON macro is now a version number.

Thanks a lot!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/akimd/bison/issues/55#issuecomment-725501151, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFOK5SY4F5BMIAG33IIBF3SPKXKFANCNFSM4S3OETXA .

-- Bazsi

bazsi

comment created time in 13 days

more