Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package byacc for openSUSE:Factory checked in at 2023-06-04 16:41:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/byacc (Old) and /work/SRC/openSUSE:Factory/.byacc.new.15902 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "byacc" Sun Jun 4 16:41:42 2023 rev:34 rq:1090644 version:20230521 Changes: -------- --- /work/SRC/openSUSE:Factory/byacc/byacc.changes 2023-03-09 17:44:38.354556371 +0100 +++ /work/SRC/openSUSE:Factory/.byacc.new.15902/byacc.changes 2023-06-04 16:41:51.441863672 +0200 @@ -1,0 +2,24 @@ +Fri Jun 2 20:59:36 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 20230521: + * error.c, defs.h, reader.c: + allow @1 or $@ with a warning if no %locations was given + * reader.c: clear pointer in end_ainfo() after freeing it. + * reader.c: report errors in %define as "unexpected value" + add/use macros begin_ainfo() and end_ainfo() to reduce clutter + * defs.h, error.c: add function unexpected_value() + * add %nterm as an alias for %type, since bison made that confusion. + * reader.c: + ensure that filler_buf and prefix_buf are initialized for the special case + where they are empty (report by Martin Jansa, cf: 20230219) + * output.c: + make test-differences smaller when compiling with YY_NO_LEAKS by replacing + a blank line with the generated #define rather than adding 3 lines. + * reader.c: + correct a use-after-free in more_curly, which could occur if a %lex-param + or %parse-param was multi-line (Redhat #2183006). + * main.c: rename no_space() to on_error() + * error.c: rename no_space() to no_error(), handling any errno + * defs.h: rename no_space() to on_error() + +------------------------------------------------------------------- Old: ---- byacc-20230219.tgz byacc-20230219.tgz.asc New: ---- byacc-20230521.tgz byacc-20230521.tgz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ byacc.spec ++++++ --- /var/tmp/diff_new_pack.eSIUxH/_old 2023-06-04 16:41:52.137867814 +0200 +++ /var/tmp/diff_new_pack.eSIUxH/_new 2023-06-04 16:41:52.141867838 +0200 @@ -18,7 +18,7 @@ Name: byacc -Version: 20230219 +Version: 20230521 Release: 0 Summary: LALR(1) parser generator License: SUSE-Public-Domain ++++++ byacc-20230219.tgz -> byacc-20230521.tgz ++++++ ++++ 5820 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/CHANGES new/byacc-20230521/CHANGES --- old/byacc-20230219/CHANGES 2023-02-19 16:08:06.000000000 +0100 +++ new/byacc-20230521/CHANGES 2023-05-21 21:59:32.000000000 +0200 @@ -1,3 +1,110 @@ +2023-05-21 Thomas E. Dickey <dic...@invisible-island.net> + + * VERSION, package/byacc.spec, package/debian/changelog, + package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + + * configure: regen + + * aclocal.m4: + updates for CF_INSTALL_MAN from reflex, which needs the symbolic link feature + + * aclocal.m4: + improve install-man by adding sed commands for --program-transform-name + +2023-05-19 Thomas E. Dickey <dic...@invisible-island.net> + + * makefile.in: use CF_INSTALL_MAN + + * aclocal.m4: + add CF_INSTALL_MAN, to begin refactoring install rule for manpage + + * configure: regen + + * configure.in: use CF_INSTALL_MAN + +2023-05-18 Thomas E. Dickey <dic...@invisible-island.net> + + * error.c, defs.h, reader.c: + allow @1 or $@ with a warning if no %locations was given + +2023-05-17 Thomas E. Dickey <dic...@invisible-island.net> + + * reader.c: clear pointer in end_ainfo() after freeing it. + +2023-05-16 Thomas E. Dickey <dic...@invisible-island.net> + + * reader.c: report errors in %define as "unexpected value" + + * reader.c: + add/use macros begin_ainfo() and end_ainfo() to reduce clutter + + * defs.h, error.c: add function unexpected_value() + + * reader.c: + recognize bison's "%define api.pure" as an alternative to "%pure-parser" + + * reader.c: + add %nterm as an alias for %type, since bison made that confusion. + + * reader.c: + ensure that filler_buf and prefix_buf are initialized for the special case + where they are empty (report by Martin Jansa, cf: 20230219) + + * output.c: + make test-differences smaller when compiling with YY_NO_LEAKS by replacing + a blank line with the generated #define rather than adding 3 lines. + + * reader.c: gcc-warnings + +2023-05-15 Thomas E. Dickey <dic...@invisible-island.net> + + * VERSION, package/byacc.spec, package/debian/changelog, + package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + + * reader.c: + when copying parameters, check for a case where the last token is not a + name, e.g., "foo [1]" would have "[1]". In this case, scan back to find + the actual parameter name. + + * reader.c: + correct a use-after-free in more_curly, which could occur if a %lex-param + or %parse-param was multi-line (Redhat #2183006). + +2023-05-11 Thomas E. Dickey <dic...@invisible-island.net> + + * main.c: rename no_space() to on_error() + + * error.c: rename no_space() to no_error(), handling any errno + + * defs.h: rename no_space() to on_error() + +2023-04-03 Thomas E. Dickey <dic...@invisible-island.net> + + * aclocal.m4: resync with my-autoconf: CF_GCC_VERSION CF_XOPEN_SOURCE + +2023-02-26 Thomas E. Dickey <dic...@invisible-island.net> + + * mstring.c, reader.c: yak-indent + +2023-02-26 mingodad + + * reader.c: + patch for byacc #6: Segmentation fault when trying to parse bison-3.8.2 grammar + +2023-02-26 Thomas E. Dickey <dic...@invisible-island.net> + + * VERSION, package/byacc.spec, package/debian/changelog, + package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2023-02-20 Thomas E. Dickey <dic...@invisible-island.net> + + * configure: regen + + * aclocal.m4: resync with my-autoconf + 2023-02-19 Thomas E. Dickey <dic...@invisible-island.net> * test/yacc/ok_syntax1.tab.h, test/yacc/ok_syntax1.tab.c, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/MANIFEST new/byacc-20230521/MANIFEST --- old/byacc-20230219/MANIFEST 2023-02-19 12:33:12.000000000 +0100 +++ new/byacc-20230521/MANIFEST 2023-05-21 21:59:32.000000000 +0200 @@ -1,4 +1,4 @@ -MANIFEST for byacc, version t20230219 +MANIFEST for byacc, version t20230521 -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGEMENTS original version of byacc - 1993 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/VERSION new/byacc-20230521/VERSION --- old/byacc-20230219/VERSION 2023-02-19 12:33:12.000000000 +0100 +++ new/byacc-20230521/VERSION 2023-05-21 21:59:32.000000000 +0200 @@ -1 +1 @@ -20230219 +20230521 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/configure.in new/byacc-20230521/configure.in --- old/byacc-20230219/configure.in 2023-02-02 01:14:51.000000000 +0100 +++ new/byacc-20230521/configure.in 2023-05-19 09:58:43.000000000 +0200 @@ -1,7 +1,7 @@ dnl Process this file with 'autoconf' to produce a 'configure' script -dnl $Id: configure.in,v 1.28 2023/02/02 00:14:51 tom Exp $ +dnl $Id: configure.in,v 1.29 2023/05/19 07:58:43 tom Exp $ AC_PREREQ(2.52.20200802) -AC_REVISION($Revision: 1.28 $) +AC_REVISION($Revision: 1.29 $) AC_INIT(main.c) AC_CONFIG_HEADER(config.h:config_h.in) @@ -60,6 +60,8 @@ CF_ENABLE_WARNINGS(Wwrite-strings,yes) CF_DISABLE_ECHO CF_DISABLE_LEAKS +CF_MANPAGE_FORMAT +CF_INSTALL_MAN CF_WITH_MAN2HTML AC_TYPE_MODE_T diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/defs.h new/byacc-20230521/defs.h --- old/byacc-20230219/defs.h 2022-11-06 22:44:54.000000000 +0100 +++ new/byacc-20230521/defs.h 2023-05-18 23:28:05.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: defs.h,v 1.71 2022/11/06 21:44:54 tom Exp $ */ +/* $Id: defs.h,v 1.74 2023/05/18 21:28:05 tom Exp $ */ #ifdef HAVE_CONFIG_H #include <config.h> @@ -122,6 +122,7 @@ ,NONPOSIX_DEBUG /* other bison "extensions", some useful */ + ,HACK_DEFINE ,ERROR_VERBOSE ,EXPECT ,EXPECT_RR @@ -187,7 +188,7 @@ #define DO_FREE(x) if (x) { FREE(x); x = 0; } -#define NO_SPACE(p) if (p == 0) no_space(); assert(p != 0) +#define NO_SPACE(p) do { if (p == 0) on_error(); assert(p != 0); } while (0) /* messages */ #define PLURAL(n) ((n) > 1 ? "s" : "") @@ -470,41 +471,45 @@ char *a_cptr; }; -extern void arg_number_disagree_warning(int a_lineno, char *a_name); -extern void arg_type_disagree_warning(int a_lineno, int i, char *a_name); -extern GCC_NORETURN void at_error(int a_lineno, char *a_line, char *a_cptr); +extern void arg_number_disagree_warning(int a_lineno, const char *a_name); +extern void arg_type_disagree_warning(int a_lineno, int i, const char *a_name); +extern GCC_NORETURN void at_error(int a_lineno, const char *a_line, const char *a_cptr); extern void at_warning(int a_lineno, int i); extern GCC_NORETURN void bad_formals(void); -extern void default_action_warning(char *s); +extern void default_action_warning(const char *s); extern void destructor_redeclared_warning(const struct ainfo *); -extern GCC_NORETURN void dollar_error(int a_lineno, char *a_line, char *a_cptr); +extern void dislocations_warning(void); +extern GCC_NORETURN void dollar_error(int a_lineno, const char *a_line, const char *a_cptr); extern void dollar_warning(int a_lineno, int i); extern GCC_NORETURN void fatal(const char *msg); -extern GCC_NORETURN void illegal_character(char *c_cptr); -extern GCC_NORETURN void illegal_tag(int t_lineno, char *t_line, char *t_cptr); +extern GCC_NORETURN void illegal_character(const char *c_cptr); +extern GCC_NORETURN void illegal_tag(int t_lineno, const char *t_line, const char *t_cptr); extern GCC_NORETURN void missing_brace(void); extern GCC_NORETURN void no_grammar(void); -extern GCC_NORETURN void no_space(void); +extern GCC_NORETURN void on_error(void); extern GCC_NORETURN void open_error(const char *filename); -extern GCC_NORETURN void over_unionized(char *u_cptr); +extern GCC_NORETURN void over_unionized(const char *u_cptr); extern void prec_redeclared(void); -extern void reprec_warning(char *s); +extern void reprec_warning(const char *s); extern void restarted_warning(void); -extern void retyped_warning(char *s); -extern void revalued_warning(char *s); -extern void start_requires_args(char *a_name); -extern GCC_NORETURN void syntax_error(int st_lineno, char *st_line, char *st_cptr); +extern void retyped_warning(const char *s); +extern void revalued_warning(const char *s); +extern void start_requires_args(const char *a_name); +extern GCC_NORETURN void syntax_error(int st_lineno, const char *st_line, const char *st_cptr); extern GCC_NORETURN void terminal_lhs(int s_lineno); -extern GCC_NORETURN void terminal_start(char *s); -extern GCC_NORETURN void tokenized_start(char *s); -extern GCC_NORETURN void undefined_goal(char *s); -extern void undefined_symbol_warning(char *s); +extern GCC_NORETURN void terminal_start(const char *s); +extern GCC_NORETURN void tokenized_start(const char *s); +extern GCC_NORETURN void undefined_goal(const char *s); +extern void undefined_symbol_warning(const char *s); extern GCC_NORETURN void unexpected_EOF(void); -extern void unknown_arg_warning(int d_lineno, const char *dlr_opt, - const char *d_arg, const char *d_line, +extern void unknown_arg_warning(int d_lineno, + const char *dlr_opt, + const char *d_arg, + const char *d_line, const char *d_cptr); extern GCC_NORETURN void unknown_rhs(int i); extern void unsupported_flag_warning(const char *flag, const char *details); +extern GCC_NORETURN void unexpected_value(const struct ainfo *); extern GCC_NORETURN void unterminated_action(const struct ainfo *); extern GCC_NORETURN void unterminated_comment(const struct ainfo *); extern GCC_NORETURN void unterminated_string(const struct ainfo *); @@ -512,11 +517,11 @@ extern GCC_NORETURN void unterminated_union(const struct ainfo *); extern void untyped_arg_warning(int a_lineno, const char *dlr_opt, const char *a_name); extern GCC_NORETURN void untyped_lhs(void); -extern GCC_NORETURN void untyped_rhs(int i, char *s); -extern GCC_NORETURN void used_reserved(char *s); +extern GCC_NORETURN void untyped_rhs(int i, const char *s); +extern GCC_NORETURN void used_reserved(const char *s); extern GCC_NORETURN void unterminated_arglist(const struct ainfo *); extern void wrong_number_args_warning(const char *which, const char *a_name); -extern void wrong_type_for_arg_warning(int i, char *a_name); +extern void wrong_type_for_arg_warning(int i, const char *a_name); /* graph.c */ extern void graph(void); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/error.c new/byacc-20230521/error.c --- old/byacc-20230219/error.c 2016-12-02 19:35:55.000000000 +0100 +++ new/byacc-20230521/error.c 2023-05-18 23:38:35.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: error.c,v 1.14 2016/12/02 18:35:55 tom Exp $ */ +/* $Id: error.c,v 1.17 2023/05/18 21:38:35 tom Exp $ */ /* routines for printing error messages */ @@ -12,10 +12,13 @@ } void -no_space(void) +on_error(void) { - fprintf(stderr, "%s: f - out of space\n", myname); - done(2); + const char *msg; + if (errno && (msg = strerror(errno)) != NULL) + fatal(msg); + else + fatal("unknown error"); } void @@ -68,7 +71,7 @@ } void -syntax_error(int st_lineno, char *st_line, char *st_cptr) +syntax_error(int st_lineno, const char *st_line, const char *st_cptr) { fprintf(stderr, "%s: e - line %d of \"%s\", syntax error\n", myname, st_lineno, input_file_name); @@ -77,6 +80,15 @@ } void +unexpected_value(const struct ainfo *a) +{ + fprintf(stderr, "%s: e - line %d of \"%s\", unexpected value\n", + myname, a->a_lineno, input_file_name); + print_pos(a->a_line, a->a_cptr); + done(1); +} + +void unterminated_comment(const struct ainfo *a) { fprintf(stderr, "%s: e - line %d of \"%s\", unmatched /*\n", @@ -113,7 +125,7 @@ } void -over_unionized(char *u_cptr) +over_unionized(const char *u_cptr) { fprintf(stderr, "%s: e - line %d of \"%s\", too many %%union \ declarations\n", myname, lineno, input_file_name); @@ -122,7 +134,7 @@ } void -illegal_tag(int t_lineno, char *t_line, char *t_cptr) +illegal_tag(int t_lineno, const char *t_line, const char *t_cptr) { fprintf(stderr, "%s: e - line %d of \"%s\", illegal tag\n", myname, t_lineno, input_file_name); @@ -131,7 +143,7 @@ } void -illegal_character(char *c_cptr) +illegal_character(const char *c_cptr) { fprintf(stderr, "%s: e - line %d of \"%s\", illegal character\n", myname, lineno, input_file_name); @@ -140,7 +152,7 @@ } void -used_reserved(char *s) +used_reserved(const char *s) { fprintf(stderr, "%s: e - line %d of \"%s\", illegal use of reserved symbol \ @@ -149,7 +161,7 @@ } void -tokenized_start(char *s) +tokenized_start(const char *s) { fprintf(stderr, "%s: e - line %d of \"%s\", the start symbol %s cannot be \ @@ -158,14 +170,14 @@ } void -retyped_warning(char *s) +retyped_warning(const char *s) { fprintf(stderr, "%s: w - line %d of \"%s\", the type of %s has been \ redeclared\n", myname, lineno, input_file_name, s); } void -reprec_warning(char *s) +reprec_warning(const char *s) { fprintf(stderr, "%s: w - line %d of \"%s\", the precedence of %s has been \ @@ -173,14 +185,14 @@ } void -revalued_warning(char *s) +revalued_warning(const char *s) { fprintf(stderr, "%s: w - line %d of \"%s\", the value of %s has been \ redeclared\n", myname, lineno, input_file_name, s); } void -terminal_start(char *s) +terminal_start(const char *s) { fprintf(stderr, "%s: e - line %d of \"%s\", the start symbol %s is a \ token\n", myname, lineno, input_file_name, s); @@ -234,7 +246,7 @@ } void -dollar_error(int a_lineno, char *a_line, char *a_cptr) +dollar_error(int a_lineno, const char *a_line, const char *a_cptr) { fprintf(stderr, "%s: e - line %d of \"%s\", illegal $-name\n", myname, a_lineno, input_file_name); @@ -243,6 +255,13 @@ } void +dislocations_warning(void) +{ + fprintf(stderr, "%s: e - line %d of \"%s\", expected %%locations\n", + myname, lineno, input_file_name); +} + +void untyped_lhs(void) { fprintf(stderr, "%s: e - line %d of \"%s\", $$ is untyped\n", @@ -251,7 +270,7 @@ } void -untyped_rhs(int i, char *s) +untyped_rhs(int i, const char *s) { fprintf(stderr, "%s: e - line %d of \"%s\", $%d (%s) is untyped\n", myname, lineno, input_file_name, i, s); @@ -267,7 +286,7 @@ } void -default_action_warning(char *s) +default_action_warning(const char *s) { fprintf(stderr, "%s: w - line %d of \"%s\", the default action for %s assigns an \ @@ -276,14 +295,14 @@ } void -undefined_goal(char *s) +undefined_goal(const char *s) { fprintf(stderr, "%s: e - the start symbol %s is undefined\n", myname, s); done(1); } void -undefined_symbol_warning(char *s) +undefined_symbol_warning(const char *s) { fprintf(stderr, "%s: w - the symbol %s is undefined\n", myname, s); } @@ -306,7 +325,7 @@ } void -at_error(int a_lineno, char *a_line, char *a_cptr) +at_error(int a_lineno, const char *a_line, const char *a_cptr) { fprintf(stderr, "%s: e - line %d of \"%s\", illegal @$ or @N reference\n", @@ -326,7 +345,7 @@ } void -arg_number_disagree_warning(int a_lineno, char *a_name) +arg_number_disagree_warning(int a_lineno, const char *a_name) { fprintf(stderr, "%s: w - line %d of \"%s\", number of arguments of %s " "doesn't agree with previous declaration\n", @@ -343,7 +362,7 @@ } void -arg_type_disagree_warning(int a_lineno, int i, char *a_name) +arg_type_disagree_warning(int a_lineno, int i, const char *a_name) { fprintf(stderr, "%s: w - line %d of \"%s\", type of argument %d " "to %s doesn't agree with previous declaration\n", @@ -351,8 +370,10 @@ } void -unknown_arg_warning(int d_lineno, const char *dlr_opt, const char *d_arg, const char - *d_line, const char *d_cptr) +unknown_arg_warning(int d_lineno, const char *dlr_opt, + const char *d_arg, + const char *d_line, + const char *d_cptr) { fprintf(stderr, "%s: w - line %d of \"%s\", unknown argument %s%s\n", myname, d_lineno, input_file_name, dlr_opt, d_arg); @@ -376,7 +397,7 @@ } void -wrong_type_for_arg_warning(int i, char *a_name) +wrong_type_for_arg_warning(int i, const char *a_name) { fprintf(stderr, "%s: w - line %d of \"%s\", wrong type for default argument %d to %s\n", @@ -385,7 +406,7 @@ } void -start_requires_args(char *a_name) +start_requires_args(const char *a_name) { fprintf(stderr, "%s: w - line %d of \"%s\", start symbol %s requires arguments\n", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/main.c new/byacc-20230521/main.c --- old/byacc-20230219/main.c 2021-08-08 22:39:34.000000000 +0200 +++ new/byacc-20230521/main.c 2023-05-11 09:51:36.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.73 2021/08/08 20:39:34 tom Exp $ */ +/* $Id: main.c,v 1.74 2023/05/11 07:51:36 tom Exp $ */ #include <signal.h> #if !defined(_WIN32) || defined(__MINGW32__) @@ -563,8 +563,8 @@ alloc_file_name(size_t len, const char *suffix) { char *result = TMALLOC(char, len + strlen(suffix) + 1); - if (result == 0) - no_space(); + if (result == NULL) + on_error(); strcpy(result, file_prefix); strcpy(result + len, suffix); return result; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/makefile.in new/byacc-20230521/makefile.in --- old/byacc-20230219/makefile.in 2022-11-06 22:03:11.000000000 +0100 +++ new/byacc-20230521/makefile.in 2023-05-20 01:16:31.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: makefile.in,v 1.25 2022/11/06 21:03:11 tom Exp $ +# $Id: makefile.in,v 1.26 2023/05/19 23:16:31 tom Exp $ # # UNIX template-makefile for Berkeley Yacc @@ -99,7 +99,7 @@ install: all installdirs $(INSTALL_PROGRAM) $(THIS)$x $(bindir)/$(actual_bin) - - $(INSTALL_DATA) $(srcdir)/$(THIS).1 $(mandir)/$(actual_man) + @ $(SHELL) ./install-man $(srcdir)/$(THIS).1 $(mandir)/$(actual_man) installdirs: mkdir -p $(bindir) @@ -107,7 +107,7 @@ uninstall: - rm -f $(bindir)/$(actual_bin) - - rm -f $(mandir)/$(actual_man) + @ $(SHELL) ./install-man $(mandir)/$(actual_man) ################################################################################ .SUFFIXES : .c $o .i .skel @@ -135,7 +135,7 @@ - rm -f $(THIS)$x distclean :: clean - - rm -f config.log config.cache config.status config.h makefile man2html.tmp + - rm -f config.log config.cache config.status config.h makefile man2html.tmp install-man* - rm -f $(testdir)/yacc/test-* $(testdir)/btyacc/test-* realclean :: distclean diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/mstring.c new/byacc-20230521/mstring.c --- old/byacc-20230219/mstring.c 2019-11-20 00:54:53.000000000 +0100 +++ new/byacc-20230521/mstring.c 2023-02-26 11:15:01.000000000 +0100 @@ -1,4 +1,4 @@ -/* $Id: mstring.c,v 1.9 2019/11/19 23:54:53 tom Exp $ */ +/* $Id: mstring.c,v 1.10 2023/02/26 10:15:01 tom Exp $ */ #include <stdlib.h> #include <stdio.h> @@ -40,7 +40,7 @@ do { va_start(args, fmt); - len = (size_t) vsnprintf(buf_ptr, buf_len, fmt, args); + len = (size_t)vsnprintf(buf_ptr, buf_len, fmt, args); va_end(args); if ((changed = (len > buf_len)) != 0) { @@ -57,17 +57,17 @@ while (changed); #else va_start(args, fmt); - len = (size_t) vsprintf(buf_ptr, fmt, args); + len = (size_t)vsprintf(buf_ptr, fmt, args); va_end(args); if (len >= buf_len) return; #endif - if (len > (size_t) (s->end - s->ptr)) + if (len > (size_t)(s->end - s->ptr)) { char *new_base; - size_t cp = (size_t) (s->ptr - s->base); - size_t cl = (size_t) (s->end - s->base); + size_t cp = (size_t)(s->ptr - s->base); + size_t cl = (size_t)(s->end - s->base); size_t nl = cl; while (len > (nl - cp)) nl = nl + nl + TAIL; @@ -97,7 +97,7 @@ return ch; if (s->ptr == s->end) { - size_t len = (size_t) (s->end - s->base); + size_t len = (size_t)(s->end - s->base); if ((s->base = realloc(s->base, len + len + TAIL))) { s->ptr = s->base + len; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/output.c new/byacc-20230521/output.c --- old/byacc-20230219/output.c 2022-01-09 19:03:56.000000000 +0100 +++ new/byacc-20230521/output.c 2023-05-16 23:19:48.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: output.c,v 1.100 2022/01/09 18:03:56 tom Exp $ */ +/* $Id: output.c,v 1.101 2023/05/16 21:19:48 tom Exp $ */ #include "defs.h" @@ -1623,21 +1623,14 @@ if (fp == code_file) ++outline; fprintf(fp, "#define YYPURE %d\n", pure_parser); - putc_code(fp, '\n'); -} - #if defined(YY_NO_LEAKS) -static void -output_no_leaks(FILE * fp) -{ - putc_code(fp, '\n'); - if (fp == code_file) ++outline; fputs("#define YY_NO_LEAKS 1\n", fp); +#else putc_code(fp, '\n'); -} #endif +} static void output_trailing_text(void) @@ -2092,9 +2085,6 @@ output_prefix(fp); output_pure_parser(fp); -#if defined(YY_NO_LEAKS) - output_no_leaks(fp); -#endif output_stored_text(fp); output_stype(fp); #if defined(YYBTYACC) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/package/byacc.spec new/byacc-20230521/package/byacc.spec --- old/byacc-20230219/package/byacc.spec 2023-02-19 12:33:12.000000000 +0100 +++ new/byacc-20230521/package/byacc.spec 2023-05-21 21:59:32.000000000 +0200 @@ -1,12 +1,12 @@ Summary: public domain Berkeley LALR Yacc parser generator %global AppVersion 2.0 -%global AppPatched 20230219 +%global AppPatched 20230521 %global AltProgram byacc2 %global UseProgram yacc -# $Id: byacc.spec,v 1.71 2023/02/19 11:33:12 tom Exp $ +# $Id: byacc.spec,v 1.74 2023/05/21 19:59:32 tom Exp $ Name: byacc Version: %{AppVersion}.%{AppPatched} Release: 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/package/debian/changelog new/byacc-20230521/package/debian/changelog --- old/byacc-20230219/package/debian/changelog 2023-02-19 12:33:12.000000000 +0100 +++ new/byacc-20230521/package/debian/changelog 2023-05-21 21:59:32.000000000 +0200 @@ -1,3 +1,15 @@ +byacc (1:2.0.20230521) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dic...@invisible-island.net> Wed, 10 May 2023 18:06:06 -0400 + +byacc (1:2.0.20230226) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dic...@invisible-island.net> Sun, 26 Feb 2023 04:49:18 -0500 + byacc (1:2.0.20230219) unstable; urgency=low * maintenance updates diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/package/mingw-byacc.spec new/byacc-20230521/package/mingw-byacc.spec --- old/byacc-20230219/package/mingw-byacc.spec 2023-02-19 12:33:12.000000000 +0100 +++ new/byacc-20230521/package/mingw-byacc.spec 2023-05-21 21:59:32.000000000 +0200 @@ -1,11 +1,11 @@ Summary: public domain Berkeley LALR Yacc parser generator %global AppVersion 2.0 -%global AppPatched 20230219 +%global AppPatched 20230521 %global UseProgram yacc -# $Id: mingw-byacc.spec,v 1.48 2023/02/19 11:33:12 tom Exp $ +# $Id: mingw-byacc.spec,v 1.51 2023/05/21 19:59:32 tom Exp $ Name: byacc Version: %{AppVersion}.%{AppPatched} Release: 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/package/pkgsrc/Makefile new/byacc-20230521/package/pkgsrc/Makefile --- old/byacc-20230219/package/pkgsrc/Makefile 2023-02-19 12:33:12.000000000 +0100 +++ new/byacc-20230521/package/pkgsrc/Makefile 2023-05-21 21:59:32.000000000 +0200 @@ -1,7 +1,7 @@ # $NetBSD: Makefile,v 1.24 2021/08/14 01:04:32 mef Exp $ # -DISTNAME= byacc-20230219 +DISTNAME= byacc-20230521 CATEGORIES= devel MASTER_SITES= https://invisible-mirror.net/archives/byacc/ DIST_SUBDIR= byacc-20220101 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/byacc-20230219/reader.c new/byacc-20230521/reader.c --- old/byacc-20230219/reader.c 2023-02-19 15:58:11.000000000 +0100 +++ new/byacc-20230521/reader.c 2023-05-18 23:18:17.000000000 +0200 @@ -1,4 +1,4 @@ -/* $Id: reader.c,v 1.92 2023/02/19 14:58:11 tom Exp $ */ +/* $Id: reader.c,v 1.104 2023/05/18 21:18:17 tom Exp $ */ #include "defs.h" @@ -23,6 +23,8 @@ /* limit the size of optional names for %union */ #define NAME_LEN 32 +#define IS_ALNUM(c) (isalnum(c) || (c) == '_') + #define begin_case(f,n) fprintf(f, "case %d:\n", (int)(n)) #define end_case(f) \ @@ -30,6 +32,17 @@ fprintf_lineno(f, 1, ""); \ fprintf(f, "break;\n") +#define begin_ainfo(data, offset) do { \ + data.a_lineno = lineno; \ + data.a_line = dup_line(); \ + data.a_cptr = data.a_line + (cptr - line - offset); \ + } while (0) + +#define end_ainfo(data) do { \ + FREE(data.a_line); \ + memset(&data, 0, sizeof(data)); \ + } while (0) + static void start_rule(bucket *bp, int s_lineno); #if defined(YYBTYACC) static void copy_initial_action(void); @@ -47,8 +60,22 @@ static char saw_eof; char unionized; -char *cptr, *line; -static int linesize; + +char *line; /* current input-line */ +char *cptr; /* position within current input-line */ +static size_t linesize; /* length of current input-line */ + +typedef struct +{ + char *line_data; /* saved input-line */ + size_t line_used; /* position within saved input-line */ + size_t line_size; /* length of saved input-line */ + fpos_t line_fpos; /* pointer before reading past saved input-line */ +} +SAVE_LINE; + +static SAVE_LINE save_area; +static int must_save; /* request > 0, triggered < 0, inactive 0 */ static bucket *goal; static Value_t prec; @@ -268,14 +295,58 @@ } static void +save_line(void) +{ + /* remember to save the input-line if we call get_line() */ + if (!must_save) + { + must_save = 1; + save_area.line_used = (size_t)(cptr - line); + } +} + +static void +restore_line(void) +{ + /* if we saved the line, restore it */ + if (must_save < 0) + { + free(line); + line = save_area.line_data; + cptr = save_area.line_used + line; + linesize = save_area.line_size; + if (fsetpos(input_file, &save_area.line_fpos) != 0) + on_error(); + memset(&save_area, 0, sizeof(save_area)); + } + else if (must_save > 0) + { + cptr = line + save_area.line_used; + } + must_save = 0; +} + +static void get_line(void) { FILE *f = input_file; + if (must_save > 0) + { + save_area.line_data = TMALLOC(char, linesize); + save_area.line_used = (size_t)(cptr - line); + save_area.line_size = linesize; + NO_SPACE(save_area.line_data); + memcpy(save_area.line_data, line, linesize); + if (fgetpos(f, &save_area.line_fpos) != 0) + on_error(); + must_save = -must_save; + } + do { int c; - int i; + size_t i; if (saw_eof || (c = getc(f)) == EOF) { @@ -351,9 +422,8 @@ { char *s; struct ainfo a; - a.a_lineno = lineno; - a.a_line = dup_line(); - a.a_cptr = a.a_line + (cptr - line); + + begin_ainfo(a, 0); s = cptr + 2; for (;;) @@ -361,7 +431,7 @@ if (*s == '*' && s[1] == '/') { cptr = s + 2; - FREE(a.a_line); + end_ainfo(a); return; } if (*s == '\n') @@ -428,6 +498,7 @@ { switch (ch = next_inline()) { + case '\0': case '\n': get_line(); break; @@ -462,6 +533,7 @@ { "binary", NONASSOC }, { "code", XCODE }, { "debug", NONPOSIX_DEBUG }, + { "define", HACK_DEFINE }, #if defined(YYBTYACC) { "destructor", DESTRUCTOR }, #endif @@ -478,6 +550,7 @@ { "locations", LOCATIONS }, #endif { "nonassoc", NONASSOC }, + { "nterm", TYPE }, { "parse-param", PARSE_PARAM }, { "pure-parser", PURE_PARSER }, { "right", RIGHT }, @@ -600,9 +673,8 @@ { struct mstring *temp = msnew(); struct ainfo a; - a.a_lineno = lineno; - a.a_line = dup_line(); - a.a_cptr = a.a_line + (cptr - line - 1); + + begin_ainfo(a, 1); for (;;) { @@ -611,7 +683,7 @@ mputc(temp, c); if (c == quote) { - FREE(a.a_line); + end_ainfo(a); return msdone(temp); } if (c == '\n') @@ -652,9 +724,8 @@ else if (c == '*') { struct ainfo a; - a.a_lineno = lineno; - a.a_line = dup_line(); - a.a_cptr = a.a_line + (cptr - line - 1); + + begin_ainfo(a, 1); mputc(temp, c); ++cptr; @@ -666,7 +737,7 @@ { mputc(temp, '/'); ++cptr; - FREE(a.a_line); + end_ainfo(a); return msdone(temp); } if (c == '\n') @@ -709,6 +780,16 @@ c = *++cptr; if (c == EOF) unexpected_EOF(); + if (c == '\0') + { + get_line(); + if (line == NULL) + { + unexpected_EOF(); + /*NOTREACHED */ + } + c = *cptr; + } if (isspace(UCH(c))) continue; @@ -809,9 +890,8 @@ FILE *f = text_file; int need_newline = 0; struct ainfo a; - a.a_lineno = lineno; - a.a_line = dup_line(); - a.a_cptr = a.a_line + (cptr - line - 2); + + begin_ainfo(a, 2); if (*cptr == '\n') { @@ -861,7 +941,7 @@ if (need_newline) putc('\n', f); ++cptr; - FREE(a.a_line); + end_ainfo(a); return; } /* FALLTHRU */ @@ -904,9 +984,10 @@ size_t filler_len = 0; int in_prefix = 1; - a.a_lineno = lineno; - a.a_line = dup_line(); - a.a_cptr = a.a_line + (cptr - line - 6); + prefix_buf[0] = '\0'; + filler_buf[0] = '\0'; + + begin_ainfo(a, 6); if (unionized) over_unionized(cptr - 6); @@ -948,7 +1029,7 @@ puts_both(filler_buf); filler_len = 0; } - filler_buf[filler_len++] = (char) c; + filler_buf[filler_len++] = (char)c; filler_buf[filler_len] = 0; if (c != '\n') goto loop; @@ -957,7 +1038,7 @@ { if (prefix_len < NAME_LEN) { - prefix_buf[prefix_len++] = (char) c; + prefix_buf[prefix_len++] = (char)c; prefix_buf[prefix_len] = 0; } goto loop; @@ -988,7 +1069,7 @@ puts_both(" YYSTYPE;\n"); } puts_both("#endif /* !YYSTYPE_IS_DECLARED */\n"); - FREE(a.a_line); + end_ainfo(a); return; } goto loop; @@ -1074,9 +1155,9 @@ static int more_curly(void) { - char *save = cptr; int result = 0; int finish = 0; + save_line(); do { switch (next_inline()) @@ -1093,7 +1174,7 @@ ++cptr; } while (!finish); - cptr = save; + restore_line(); return result; } @@ -1110,6 +1191,24 @@ buffer[type2] = '\0'; (void)trim_blanks(p->type2); + if (!IS_ALNUM(buffer[name])) + { + int n; + for (n = name - 1; n >= 0; --n) + { + if (!isspace(UCH(buffer[n]))) + { + break; + } + } + while (n > 0) + { + if (!IS_ALNUM(UCH(buffer[n - 1]))) + break; + --n; + } + name = n; + } p->name = strdup(buffer + name); NO_SPACE(p->name); buffer[name] = '\0'; @@ -1297,7 +1396,7 @@ type2 = i + 1; } - while (i > 0 && (isalnum(UCH(parms[i])) || UCH(parms[i]) == '_')) + while (i > 0 && IS_ALNUM(UCH(parms[i]))) i--; if (!isspace(UCH(parms[i])) && parms[i] != '*') @@ -1337,9 +1436,8 @@ char *s; bucket *bp; struct ainfo a; - a.a_lineno = lineno; - a.a_line = dup_line(); - a.a_cptr = a.a_line + (cptr - line); + + begin_ainfo(a, 0); quote = *cptr++; cinc = 0; @@ -1432,7 +1530,7 @@ } cachec(c); } - FREE(a.a_line); + end_ainfo(a); n = cinc; s = TMALLOC(char, n); @@ -1799,6 +1897,82 @@ } #endif +static int +scan_blanks(void) +{ + int c; + + do + { + c = next_inline(); + if (c == '\n') + { + ++cptr; + return 0; + } + else if (c == ' ' || c == '\t') + ++cptr; + else + break; + } + while (c == ' ' || c == '\t'); + + return 1; +} + +static int +scan_ident(void) +{ + int c; + + cinc = 0; + for (c = *cptr; IS_IDENT(c); c = *++cptr) + cachec(c); + cachec(NUL); + + return cinc; +} + +static void +hack_defines(void) +{ + struct ainfo a; + + if (!scan_blanks()) + return; + + begin_ainfo(a, 0); + if (!scan_ident()) + { + end_ainfo(a); + } + + if (!strcmp(cache, "api.pure")) + { + end_ainfo(a); + scan_blanks(); + begin_ainfo(a, 0); + scan_ident(); + + if (!strcmp(cache, "false")) + pure_parser = 0; + else if (!strcmp(cache, "true") + || !strcmp(cache, "full") + || *cache == 0) + pure_parser = 1; + else + unexpected_value(&a); + end_ainfo(a); + } + else + { + unexpected_value(&a); + } + + while (next_inline() != '\n') + ++cptr; +} + static void declare_types(void) { @@ -1957,6 +2131,10 @@ tflag = 1; break; + case HACK_DEFINE: + hack_defines(); + break; + case POSIX_YACC: /* noop for bison compatibility. byacc is already designed to be posix * yacc compatible. */ @@ -2040,9 +2218,7 @@ char c, quote = 0; struct ainfo a; - a.a_lineno = lineno; - a.a_line = dup_line(); - a.a_cptr = a.a_line + (cptr - line - 1); + begin_ainfo(a, 1); while ((c = *cptr++) != R_PAREN || depth || quote) { @@ -2086,7 +2262,7 @@ } if (alen) *alen = len; - FREE(a.a_line); + end_ainfo(a); return msdone(s); } @@ -2738,9 +2914,7 @@ Value_t *offsets = NULL, maxoffset; bucket **rhs; - a.a_lineno = lineno; - a.a_line = dup_line(); - a.a_cptr = a.a_line + (cptr - line); + begin_ainfo(a, 0); if (last_was_action) insert_empty_rule(); @@ -2934,10 +3108,8 @@ { if (!locations) { - int l_lineno = lineno; - char *l_line = dup_line(); - char *l_cptr = l_line + (cptr - line); - syntax_error(l_lineno, l_line, l_cptr); + dislocations_warning(); + locations = 1; } if (cptr[1] == '$') { @@ -3006,7 +3178,7 @@ goto loop; } end_case(f); - FREE(a.a_line); + end_ainfo(a); if (maxoffset > 0) FREE(offsets); return; @@ -3026,7 +3198,7 @@ if (depth > 0) goto loop; end_case(f); - free(a.a_line); + end_ainfo(a); if (maxoffset > 0) FREE(offsets); return; @@ -3068,7 +3240,7 @@ } #endif end_case(f); - free(a.a_line); + end_ainfo(a); if (maxoffset > 0) FREE(offsets); return; @@ -3114,9 +3286,7 @@ else syntax_error(lineno, line, cptr); - a->a_lineno = lineno; - a->a_line = dup_line(); - a->a_cptr = a->a_line + (cptr - line); + begin_ainfo((*a), 0); depth = 0; loop: @@ -3154,10 +3324,8 @@ { if (!locations) { - int l_lineno = lineno; - char *l_line = dup_line(); - char *l_cptr = l_line + (cptr - line); - syntax_error(l_lineno, l_line, l_cptr); + dislocations_warning(); + locations = 1; } msprintf(code_mstr, "%s", loc); cptr += 2; @@ -3222,7 +3390,7 @@ struct ainfo a; initial_action = get_code(&a, "yyloc"); - free(a.a_line); + end_ainfo(a); } static void @@ -3304,7 +3472,7 @@ else break; } - free(a.a_line); + end_ainfo(a); free(code_text); }