Commit Graph

285540 Commits

Author SHA1 Message Date
rillig
9e32617b0c lint: rename istk to initstack_element
The longer name is more expressive and more correct.  The previous name
called each stack element a stack itself, which was unnecessarily
confusing.

No functional change.
2021-02-21 09:24:32 +00:00
rillig
1214ba323a lint: add another test case for initializing an object 2021-02-21 09:19:53 +00:00
rillig
ab7cfcc59b lint: fix wrong warning about main falling off the bottom in C99 mode
This gets lint a small step closer to implementing C99.
2021-02-21 09:17:55 +00:00
rillig
7eea542cc1 lint: force each test to declare the expected diagnostics
By listing the expected diagnostics directly at the code that triggers
the diagnostics, it is easier to cross-check whether the diagnostics
make sense.

No functional change to lint itself.
2021-02-21 09:07:58 +00:00
skrll
2e44ae2b72 KNF consistency 2021-02-21 08:47:13 +00:00
skrll
2a8fcb4ddb Some preemption updates - still not being used (yet) 2021-02-21 08:46:28 +00:00
skrll
d0aefa0270 Fixup with __HAVE_PREEMPTION code which is currently unused 2021-02-21 08:31:36 +00:00
rillig
7274e46a8c lint: reduce amount of debug output during initialization 2021-02-21 08:27:41 +00:00
rillig
331de0363e lint: add another test for C99 initializers 2021-02-21 08:05:51 +00:00
rillig
a85144e65d lint: rename members of struct istk to be more expressive
No functional change outside debug mode.
2021-02-21 08:01:14 +00:00
rillig
dc5e40131f lint: fix definition of debug_node in non-debug mode 2021-02-21 07:59:17 +00:00
tsutsui
8761f1c0f7 Consistently use motorola style. No binary changes.
Seems missed in rev 1.3:
 https://mail-index.netbsd.org/source-changes/2013/08/01/msg046378.html
2021-02-21 07:23:41 +00:00
rillig
129bdc0be2 lint: indent node details in debug mode 2021-02-21 07:21:57 +00:00
christos
2543b856e3 Add missing compatx11file 2021-02-21 02:29:56 +00:00
christos
3b19211590 set explicit_file_name when we use getopt. 2021-02-21 00:36:06 +00:00
christos
c3159922b3 new byacc 2021-02-20 22:59:37 +00:00
christos
107c160af6 merge conflicts 2021-02-20 22:57:56 +00:00
jmcneill
8ed149fbb5 Only disable/enable interrupts if processing pending interrupts, and
inline pic_set_pending_psw.
2021-02-20 22:53:31 +00:00
rillig
e83db15a89 lint: clean up some of the C99 tests
Several C99 tests do not actually test C99 features but instead GCC
features.  All these tests should be double-checked again.

In some other tests, split the initializers into more lines, which makes
it easier to read the debug log corresponding to these tests.  This will
be necessary for reworking the initializer code to actually conform to
C99.
2021-02-20 22:31:20 +00:00
rillig
cc8ff9b7e7 lint: ensure that '# line' directives in tests are correct
It's too easy to forget one of them when adding or removing some lines.
This would make it more difficult to locate the lines referenced in the
error messages.
2021-02-20 22:18:32 +00:00
christos
297954931a 2021-01-09 Thomas E. Dickey <dickey@invisible-island.net>
* package/debian/copyright, VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
	bump

2021-01-05  Thomas E. Dickey  <dickey@invisible-island.net>

	* configure: regen

	* aclocal.m4: resync with my-autoconf

2020-09-22  Thomas E. Dickey  <dickey@invisible-island.net>

	* closure.c, warshall.c:
	fix undefined-behavior diagnosed with gcc -fsanitize=undefined (report by
	Alexander Richardson)

2020-09-10  Thomas E. Dickey  <dickey@invisible-island.net>

	* LICENSE: RCS_BASE

	* reader.c, output.c: cppcheck -- reduce scope

	* defs.h: update to 2.0

	* test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/calc_code_all.tab.c, test/btyacc/calc_code_default.tab.c, test/btyacc/calc_code_imports.tab.c, test/btyacc/calc_code_provides.tab.c, test/btyacc/calc_code_requires.tab.c, test/btyacc/calc_code_top.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/defines1.calc.c, test/btyacc/defines2.calc.c, test/btyacc/defines3.calc.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, test/btyacc/error.tab.c, test/btyacc/expr.oxout.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/rename_debug.c, test/btyacc/stdin1.calc.c, test/btyacc/stdin2.calc.c, test/btyacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/calc_code_all.tab.c, test/yacc/calc_code_default.tab.c, test/yacc/calc_code_imports.tab.c, test/yacc/calc_code_provides.tab.c, test/yacc/calc_code_requires.tab.c, test/yacc/calc_code_top.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/defines1.calc.c, test/yacc/defines2.calc.c, test/yacc/defines3.calc.c, test/yacc/empty.tab.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax27.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/expr.oxout.tab.c, test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/rename_debug.c, test/yacc/stdin1.calc.c, test/yacc/stdin2.calc.c, test/yacc/varsyntax_calc1.tab.c:
	update to version 2.0

	* reader.c:
	improve loop which skips backward through a (possibly nested) sequence of
	square-brackets.

	* reader.c: simplify a check to quiet a bogus cppcheck-warning

	* yacc.1: bump date

	* reader.c: add a note about a bogus cppcheck warning

	* configure: regen

	* configure.in:
	always check for gcc attributes, to work around defect in clang's imitation
	of this feature

	* reader.c: cppcheck -- scope reduction
	cppcheck -- eliminate bogus returns after no-return functions

	* verbose.c, output.c, mkpar.c, main.c, warshall.c, lr0.c, lalr.c, graph.c, closure.c:
	cppcheck -- scope reduction

	* package/debian/compat: quiet compatibility-warning

	* yacc.1: use "ASCII" for dashes which are part of proper names

	* configure: regen

	* configure.in: switch to --enable-warnings, for consistency

	* aclocal.m4:
	resync with my-autoconf, for compiler-warning fixes with macOS

	* VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
	bump

2020-08-16  Thomas E. Dickey  <dickey@invisible-island.net>

	* config.guess, config.sub: 2020-08-17

2020-06-28  Thomas E. Dickey  <dickey@invisible-island.net>

	* config.sub: 2020/06/28

2020-06-14  Thomas E. Dickey  <dickey@invisible-island.net>

	* config.guess: 2020/04/26

2020-03-30  Thomas E. Dickey  <dickey@invisible-island.net>

	* package/debian/copyright: bump

	* test/yacc/grammar.tab.c, test/btyacc/grammar.tab.c, test/grammar.y, reader.c:
	typo found with codespell

	* yacc.1: fixes noted in the original report, overlooked in followup

2020-03-30  Bjarni.Ingi.Gislason

	* yacc.1: typography/spelling fixes - Debian #955175

2020-03-30  Thomas E. Dickey  <dickey@invisible-island.net>

	* VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
	bump

2020-03-10  Thomas E. Dickey  <dickey@invisible-island.net>

	* configure: regen

	* aclocal.m4:
	resync with my-autoconf, mostly fixes for compiler-warnings

	* configure.in: use macro to suppress X-dependency from newer macros

2019-12-20  Thomas E. Dickey  <dickey@invisible-island.net>

	* config.guess: 2019-12-21

2019-11-25  Tom.Shields

	* main.c:
	fix an inconsistency between the getopt and non-getopt configuration.
	In the former, getopt always used "yacc", not the name of the executable.

2019-11-25  Thomas E. Dickey  <dickey@invisible-island.net>

	* test/run_make.sh:
	suppress bison's -Wyacc warning, which is not useful.

	* VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
	bump

2019-11-19  Thomas E. Dickey  <dickey@invisible-island.net>

	* yacc.1: new version of manpage

	* VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
	bump

	* yacc.1: document %code

	* test/btyacc/calc_code_all.error, test/btyacc/calc_code_all.output, test/btyacc/calc_code_all.tab.c, test/btyacc/calc_code_all.tab.h, test/btyacc/calc_code_default.error, test/btyacc/calc_code_default.output, test/btyacc/calc_code_default.tab.c, test/btyacc/calc_code_default.tab.h, test/btyacc/calc_code_imports.error, test/btyacc/calc_code_imports.output, test/btyacc/calc_code_imports.tab.c, test/btyacc/calc_code_imports.tab.h, test/btyacc/calc_code_provides.error, test/btyacc/calc_code_provides.output, test/btyacc/calc_code_provides.tab.c, test/btyacc/calc_code_provides.tab.h, test/btyacc/calc_code_requires.error, test/btyacc/calc_code_requires.output, test/btyacc/calc_code_requires.tab.c, test/btyacc/calc_code_requires.tab.h, test/btyacc/calc_code_top.error, test/btyacc/calc_code_top.output, test/btyacc/calc_code_top.tab.c, test/btyacc/calc_code_top.tab.h, test/yacc/calc_code_all.tab.c, test/yacc/calc_code_all.tab.h, test/yacc/calc_code_default.tab.c, test/yacc/calc_code_provides.tab.c, test/yacc/calc_code_provides.tab.h, test/yacc/calc_code_requires.tab.c, test/yacc/calc_code_requires.tab.h, test/yacc/calc_code_top.tab.c:
	RCS_BASE

	* output.c:
	amend updates for 'outline' when processing "%code" in code-file

	* output.c:
	modify output_code_lines() to show begin/end block comments which were in
	reader.c, and to generate a #line for the code-file.

	* reader.c:
	modify copy_code() to allow for multiple %code directives for a given
	section, recording the input line-number for each directive as a #line
	in the resulting string.  remove the block start/end comments, since those
	will be done for a whole section in output.c

	* mstring.c, defs.h: add msrenew()

	* test/yacc/calc_code_all.error, test/yacc/calc_code_all.output, test/yacc/calc_code_default.error, test/yacc/calc_code_default.output, test/yacc/calc_code_default.tab.h, test/yacc/calc_code_imports.error, test/yacc/calc_code_imports.output, test/yacc/calc_code_imports.tab.c, test/yacc/calc_code_imports.tab.h, test/yacc/calc_code_provides.error, test/yacc/calc_code_provides.output, test/yacc/calc_code_requires.error, test/yacc/calc_code_requires.output, test/yacc/calc_code_top.error, test/yacc/calc_code_top.output, test/yacc/calc_code_top.tab.h:
	RCS_BASE

2019-11-18  Thomas E. Dickey  <dickey@invisible-island.net>

	* test/calc_code_imports.y, test/calc_code_all.y, test/calc_code_default.y, test/calc_code_top.y, test/calc_code_provides.y, test/calc_code_requires.y:
	RCS_BASE

2019-11-04  Michael.Forney

	* defs.h: add missing "extern" for new variable "code_lines"

2019-11-03  Thomas E. Dickey  <dickey@invisible-island.net>

	* main.c: build-fix for MinGW cross-compiling

	* output.c, reader.c: gcc-warnings

	* output.c: check validity of text_file before rewind
	remove redundant check of iflag

	* main.c: fix memory-leak reported by clang

	* mkpar.c: guard against a null-reference reported by clang (unlikely)

	* reader.c: fix two coverity warnings:
	a) resource leak on malloc-failure
	b) possible null-pointer dereference on parse-error

	* test/btyacc/err_inherit4.tab.h, test/btyacc/btyacc_demo.tab.h: regen

	* defs.h: use enum's to simplify recent change

	* mstring.c:
	enable mstring() in regular byacc, since Zoulas' change relies upon it

2019-11-03  Christos.Zoulas

	* defs.h, reader.c, output.c: add support for bison's "%code" feature
	also fix a small bug: declare YYLTYPE externally when producing locations

2019-11-03  Thomas E. Dickey  <dickey@invisible-island.net>

	* test/btyacc/help.error, test/btyacc/no_b_opt.error, test/btyacc/no_output2.error, test/btyacc/no_p_opt.error, test/yacc/help.error, test/yacc/no_b_opt.error, test/yacc/no_output2.error, test/yacc/no_p_opt.error:
	regen

	* test/run_test.sh:
	there's no standard wording for the options-errors from getopt;
	filter that to "error message" in the test reference files.

	* main.c:
	provide for using getopt(), to accommodate a case where developers have
	relied upon non-POSIX behavior.

	* test/run_test.sh:
	getopt's messages do not print the full pathname of yacc in some cases;
	adjust the sed-script which changes those to "YACC"

	* configure: regen

	* config_h.in: regen, using autoheader-252

	* configure.in: add configure check for getopt

	* configure: regen

	* aclocal.m4:
	resync with my-autoconf adds a fix which accommodates a difference in
	warning options between gcc/clang when --enable-warnings is not set.

	* VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile:
	bump

2019-09-11  Thomas E. Dickey  <dickey@invisible-island.net>

	* config.guess, config.sub: 2019-09-10
2021-02-20 20:30:06 +00:00
rillig
22478541ca lint: fix lint warning 'expression has null effect' 2021-02-20 19:56:44 +00:00
jmcneill
7ea8544678 Adjust ci_intr_depth when processing pending ints 2021-02-20 19:35:07 +00:00
jmcneill
917f9513a9 Inline "pic_do_pending_ints" in splx and check ci_pending_ipls to optimize
the common case (hw priority, no cascaded interrupts pending).

This also removes the need for the "pic_pending_used" flag, and should fix
booting on Raspberry Pi 3.
2021-02-20 19:30:46 +00:00
jmcneill
a52d1e775b daif_disable: since we read bits before setting them, if the current state
matches the desired state we can skip the daif write
2021-02-20 19:27:35 +00:00
rillig
d9430ee79d lint: fix lint warnings
No functional change.
2021-02-20 19:10:37 +00:00
rillig
d4c07c2ea4 lint: do not warn about 'do { ... } while (false)' in strict bool mode 2021-02-20 18:55:10 +00:00
rillig
2ed239de2f lint: add test for 'do { ... } while (false)' in strict bool mode
Right now, this variant of the popular macro pattern is flagged as
needing a /*CONSTCOND*/ annotation.  As with 'do { ... } while (0)',
there is nothing wrong with this pattern, therefore there should be no
warning.
2021-02-20 18:52:58 +00:00
rillig
9c7ebc631b lint: enable heuristics in test for strict bool mode
This is a preparation for allowing 'do { ... } while (false)', in
addition to the commonly used 'do { ... } while (0)', without declaring
the controlling expression /*CONSTCOND*/.
2021-02-20 18:49:26 +00:00
jmcneill
c3737d0117 remove "pic_do_pending_int() prototype; no matching function 2021-02-20 18:18:53 +00:00
rillig
3bac4cd115 lint: document how to compile lint1 in debug mode 2021-02-20 18:10:22 +00:00
tsutsui
3fc85a5fde Replace magic numbers with proper macros prepared in assym.h.
No binary changes.
Note this is a preparation for a possible fix of PR port-m68k/55990.
2021-02-20 18:04:20 +00:00
rillig
59c3c702bb lint: add test for using a bool as array index in strict bool mode 2021-02-20 18:02:58 +00:00
rillig
6669b286da lint: in debug mode, print the initialization stack
This is the central data structure of the initializations, it keeps
track of the objects that still need to be initialized.  Seeing its
contents in debug mode helps in finding and understanding the still
incomplete C99 support.
2021-02-20 17:44:39 +00:00
rillig
db97bec5bb lint: define debug_named_member only in debug mode
In non-debug mode it was an expensive no-op.
2021-02-20 17:24:37 +00:00
rillig
8f1bf5e205 lint: document an assumption that has turned wrong with C99 2021-02-20 17:12:00 +00:00
rillig
c76961adb2 lint: add machine-readable expectations to test for initializer 2021-02-20 16:55:32 +00:00
rillig
2a03f024cd lint: fix typo in test for pop_member
The leader of a city should rather be a mayor than a major.
2021-02-20 16:51:18 +00:00
rillig
56d3e49d54 lint: extend debugging for initializing objects
No functional change outside debug mode.
2021-02-20 16:34:57 +00:00
rillig
92a76c943c lint: rename mkinit to init_using_expr
No functional change outside debug mode.
2021-02-20 16:03:56 +00:00
rillig
039617c180 lint: add hierarchical debug logging for initializations
No functional change for default mode.
2021-02-20 15:23:07 +00:00
jmcneill
7987f42723 Move 'struct pic_pending' from percpu to struct cpu_info. Saves a few
instructions in splx.
2021-02-20 14:51:06 +00:00
skrll
7a3cc25e41 Reapply the following change - Simon's first attempt had a missing ';'
release builds done for cobalt and evbmips64-eb

Provide an __eprol symbol in TEXT_START_SYMBOLS.  MIPS overrides
TEXT_START_SYMBOLS so it misses out on the default definition of
this that does provide an __eprol symbol.  Fixes linking of profiled
binaries.
2021-02-20 14:48:07 +00:00
jmcneill
3de14f28bd Sync with OpenBSD r1.99:
move the rearming of the cq after the refill of the rq.

   this is the only real diff we have left outstanding on a box that
   experienced rx lockups. since adding this change it's been happy
   for the last 4 weeks and counting so far.
2021-02-20 13:31:35 +00:00
rillig
486e361bf3 lint: make parsing of GCC line directives stricter
The previous code accepted '# 123 "file.c" 23' as specifying a system
header, just because that number ends with '3'.  The original intention
was to compare the complete word, not its suffix.  Fix that.

No practical change since the only flags that are used by GCC are all
single-digit.
2021-02-20 11:06:56 +00:00
rillig
2cab38691c lint: reduce duplicate code in check for getopt
This also changes the conditions to their positive form, which is easier
to read.

No functional change.  The resulting binary would have been the same as
before, were it not for the changed line numbers in the lint_assert
calls further down in the code.
2021-02-20 10:12:52 +00:00
rillig
7f300e59ba lint: clean up check for getopt
The original options string is not needed during the check.  Having only
the unhandled options suffices.

No functional change.
2021-02-20 10:01:27 +00:00
rillig
46a713f776 lint: fix crash from ckgetopt.c 1.2 and document the data structures 2021-02-20 09:57:02 +00:00
rin
55b56938ed Misc style fixes. No binary changes.
- Use uint{32,8}_t instead of unsigned {int, char}.
- Sort headers.
- KNF
2021-02-20 09:51:20 +00:00
rillig
6e51f5af89 lint: reproduce the crash from ckgetopt.c 1.2
The intention of the getopt check was to analyze only those while loops
whose condition consists of the usual getopt call.  For all other while
loops, ck.while_level was intended to stay at 0.

This was not the case in ckgetopt.c 1.2 and has been fixed in ckgetopt.c
1.3.  The code did not document the intended invariants though, which it
should have done.  This will be done in a follow-up commit.
2021-02-20 09:40:42 +00:00