Commit Graph

5725 Commits

Author SHA1 Message Date
Josh Soref
95e1b48e20 spelling: complete 2018-10-05 07:01:04 +02:00
Josh Soref
bb077f38f7 spelling: compatibility 2018-10-05 07:01:04 +02:00
Josh Soref
a6316700e8 spelling: comparison 2018-10-05 07:01:04 +02:00
Josh Soref
795f7e32cc spelling: combination 2018-10-05 07:01:04 +02:00
Josh Soref
c721eb9e28 spelling: characters 2018-10-05 07:01:04 +02:00
Josh Soref
3aed6a21f5 spelling: builddir 2018-10-05 07:01:04 +02:00
Josh Soref
b6d3f107fe spelling: assoc 2018-10-05 07:01:03 +02:00
Josh Soref
704a04512c spelling: appropriate 2018-10-05 07:01:03 +02:00
Josh Soref
2586398fcc spelling: alignment 2018-10-05 07:01:03 +02:00
Josh Soref
d9b37a62ff spelling: aggregate 2018-10-05 07:01:03 +02:00
Josh Soref
3d2bf2a8e3 spelling: adjust 2018-10-05 07:01:03 +02:00
Josh Soref
a3ced22c06 spelling: additional 2018-10-05 07:01:03 +02:00
Josh Soref
a2b6281b39 spelling: accurately 2018-10-05 07:01:03 +02:00
Akim Demaille
cf4600ca45 README-hacking: details about make check-local 2018-10-05 06:21:59 +02:00
Akim Demaille
8d64416e8c gnulib: update 2018-10-05 06:14:20 +02:00
Akim Demaille
26859f6d61 main: fix error message for missing argument
* src/getargs.c (getargs): Don't display any argv other that argv[0]
when reporting a missing argument.
* tests/bison.in: Neutralize path differences in stderr.
* tests/input.at (Invalid number of arguments): New.
2018-10-04 22:24:11 +02:00
Akim Demaille
f84a8e96d1 gnulib: move timevar to it
* lib/timevar.c, lib/timevar.h, m4/timevar.m4: Remove.
* gnulib: Update.
* configure.ac: Adjust.
* lib/timevar.def: Use lower case for the timevvars.
Adjust dependencies.
2018-09-30 14:19:53 +02:00
Akim Demaille
4247df921b style: comment changes
* data/glr.cc, data/lalr1.cc: here.
2018-09-29 12:19:33 +02:00
Akim Demaille
9bdff3d271 gnulib: update 2018-09-29 09:39:00 +02:00
Paul Eggert
d03b1a7e8c getargs: use LC_MESSAGES trick only on glibc
* src/getargs.c (usage): Rely on setlocale (LC_MESSAGES, NULL)
trick only on glibc, as POSIX does not specify the output
of setlocale in this case, and the Gnulib localename module
source code indicates that the trick works only on glibc.
2018-09-28 16:41:41 -07:00
Paul Eggert
973c456f63 uniqstr: avoid need for VLAs
C11 no longer requires support for variable-length arrays, and
VS2015 does not have them.  Redo UNIQSTR_CONCAT to use a method
that is simpler and better anyway.
* src/uniqstr.c (uniqstr_vsprintf): Remove; no longer needed.
* src/uniqstr.h (UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_):
* src/uniqstr.c (uniqstr_concat): New function.
* src/uniqstr.h (UNIQSTR_CONCAT): Use it instead of using
uniqstr_vsprintf.
2018-09-28 16:41:41 -07:00
Akim Demaille
2d07940325 doc: clean up the C++ section
* doc/bison.texi: Minor fixes in typography.
It is no longer require to pass --defines for C++ (it was addressed
long ago).
No longer refer to the `variant` define variable, it was replaced by
`api.value.type variant`.
Prefer nullptr to 0 for the null pointer.
Use deftypeop for constructors.
(Complete Symbols): Give the expected signature of yylex.
Don't document the symbol_type constructors, as we want users to focus
on make_TOKEN.
Also show the case without locations.
2018-09-26 21:49:20 +02:00
Akim Demaille
13cdb2d397 CI: fixes for clang and asan
Bison's test 464 (Syntax error as exception) fails on the CI.
Do not use clang with asan on Ubuntu's libc++.
https://bugs.llvm.org/show_bug.cgi?id=17379

* .travis.yml (Clang 7 libc++ and ASAN): New.
(Clang 6 -O3 and libc++): Really use libc++.
(Clang 5): Don't use libc++, nor asan (does not work either, same
reason).
2018-09-26 16:22:32 +02:00
Akim Demaille
b2a3a302e6 style: reduce scopes in muscle-tab.c 2018-09-24 21:52:56 +02:00
Akim Demaille
8c4a1163ee style: remove useless parens
* data/bison.m4, data/glr.c, data/glr.cc, data/lalr1.cc,
* data/lalr1.java, data/location.cc, data/yacc.c: Call b4_output_end
without parens.
2018-09-24 21:52:55 +02:00
Akim Demaille
cf4e3eecef c++: fix warning message for automove
* src/scan-code.l: Remove 'enabled'.
Use only $k (numeric), even for named references, for clarity.
* tests/c++.at: Adjust expectations.
2018-09-24 21:52:55 +02:00
Akim Demaille
2eaa7ed946 style: minor refactoring
* data/bison.m4: Formatting changes.
* src/scan-code.l: Avoid loops, prefer standard string functions.
(find_prefix_end): Be const correct.
Avoid useless intermediate variables.
(variant_add): Be const correct.
(parse_ref): Prefer variable definitions to assignments.
2018-09-24 21:52:55 +02:00
Akim Demaille
e198269f40 CI: don't exit
* .travis.yml: Prefer `false` to `exit`, as it completely ends the
script (so we don't get the logs).
2018-09-24 21:52:55 +02:00
Akim Demaille
6181f05630 CI: really use Clang 3.3 and 3.4, not 5.0
* .travis.yml: Don't define CC/CXX, it does not work.
Use `[[...]]` instead of `[...]`.
Show the compiler versions.
(Clang 3.3, Clang 3.4): Specify the path to avoid using
/usr/local/clang-5.0.0/bin's clang.
2018-09-24 21:52:55 +02:00
Akim Demaille
a4ba0d21a1 CI: more compiler configurations
* .travis.yml (GCC 8): Use sanitizers.
(Clang 5 -O3): Remove, replaced by...
(Clang 7 ASAN and libc++, Clang 6 -O3 and libc++): New.
2018-09-23 13:16:40 +02:00
Akim Demaille
5d0764d23b build: rename and simplify the -std checks for C++
Too much code duplication.

* m4/bison-cxx-std.m4: s/BISON_CXX_COMPILE_STDCXX/BISON_CXXSTD/.
(BISON_CXXSTD): New.
* configure.ac: Use it.
2018-09-23 11:50:58 +02:00
Akim Demaille
41ded58286 build: check for C++98 and 03 like the others
* m4/bison-cxx-std.m4 (BISON_CXX_COMPILE_STDCXX_98)
(BISON_CXX_COMPILE_STDCXX_03): New.
* configure.ac: Use them.
2018-09-23 11:50:58 +02:00
Akim Demaille
5649888686 build: use our own version of ax_check_link_flag
The message on configure is misleading:

    checking whether the linker accepts -std=c++11... yes
    checking whether the linker accepts -std=c++14... yes
    checking whether the linker accepts -std=c++17... no

It is the compiler that we check, not just the linker.

* m4/ax_check_link_flag.m4: Remove.
* m4/bison-check-compiler-flag.m4: New.
* m4/bison-cxx-std.m4: Use it.
2018-09-23 11:50:58 +02:00
Akim Demaille
e40a3eed34 build: fix Autoconf macros to check for C++ standard flags
* m4/bison-cxx-std.m4: Since now we link the program, we need a
program: main was missing and linking was failing.
2018-09-23 11:50:58 +02:00
Akim Demaille
6537a59c98 tests: fix a memory leak
This has been bugging me for while.  I was hard to reproduce: it
worked only on GNU/Linux, probably because libc++ implements the small
string optimization, while libstdc++ did not and actually allocated on
the heap for this small string.

See https://lists.gnu.org/archive/html/bison-patches/2018-09/msg00110.html.

* tests/types.at (api.value.type): Do not provide a semantic value to
EOF.
2018-09-23 11:50:58 +02:00
Akim Demaille
154bc7ddac doc: work around Flex's use of 'register'
The CI uses an old version of Flex.
See 65fa634cdc.

* doc/bison.texi (calc++/scanner.ll): Here.
2018-09-22 19:40:37 +02:00
Akim Demaille
a990213582 timevar: don't declare getrusage if we don't use it
This fails on MinGW.
Reported by Simon Sobisch.
http://lists.gnu.org/archive/html/bug-bison/2018-09/msg00058.html

* lib/timevar.c: Don't provide default prototypes for functions
we don't use.
2018-09-22 15:58:27 +02:00
Akim Demaille
9dfd46a5d5 timevar: get rid of a useless macro
* lib/timevar.h (timevar_report): Rename as...
(timevar_enabled): this.
* lib/timevar.c (TIMEVAR_ENABLE): Remove.
2018-09-22 15:58:27 +02:00
Akim Demaille
984d8cc72c timevar: introduce and use get_current_time
* lib/timevar.c: here.
Remove useless prototypes.
(timevar_accumulate): Be const correct.
2018-09-22 15:58:27 +02:00
Akim Demaille
896b2f75c5 timevar: rename get_time as set_to_current_time
* lib/timevar.c: here.
2018-09-22 15:58:27 +02:00
Akim Demaille
3ce67fa673 timevar: reduce scopes
* lib/timevar.c: here.
2018-09-22 15:58:27 +02:00
Akim Demaille
889dea0275 timevar: document in the header, not in the implementation
* lib/timevar.c: Move documentation from here...
* lib/timevar.h: to there.
2018-09-22 15:58:27 +02:00
Akim Demaille
ab3ec56ffe timevar: remove useless 'extern' for prototypes
* lib/timevar.h, lib/timevar.c: here.
2018-09-22 15:58:27 +02:00
Akim Demaille
c8da23c372 timevar: rename init_timevar as timevar_init
* lib/timevar.h, lib/timevar.c: here.
* src/main.c: Adjust.
2018-09-22 15:58:27 +02:00
Akim Demaille
69720f1231 timevar: we don't care about backward compatibility
* lib/timevar.h, lib/timevar.c (get_run_time, print_time): Remove.
2018-09-22 15:58:27 +02:00
Akim Demaille
100f8696c7 timevar: prefer #elif
* lib/timevar.c: Use #if/#elif to be clearer about mutually exclusive
cases.
Indent CPP nested directives.
2018-09-22 15:58:27 +02:00
Akim Demaille
8c6b06df1f timevar: assume ANSI C
Suggested by Bruno Haible.
https://lists.gnu.org/archive/html/bug-gnulib/2018-09/msg00102.html

* lib/timevar.c: Wow...  This was still KnR C!
2018-09-22 15:58:27 +02:00
Akim Demaille
6d9aafc5ad timevar: remove remains of GCC
* lib/timevar.h, lib/timevar.c: Rename the header guard.
Get rid of parts meant for GCC only.
2018-09-22 15:58:27 +02:00
Akim Demaille
878dc0a172 news: c++: move semantics 2018-09-22 14:52:13 +02:00
Akim Demaille
a874011e37 c++: issue a warning with a value is moved several times
Suggested by Frank Heckenbach.
http://lists.gnu.org/archive/html/bug-bison/2018-09/msg00022.html

* src/scan-code.l (parse_ref): Check multiple occurrences of rhs
values.
* tests/c++.at (Multiple occurrences of $n and api.value.automove): New.
2018-09-22 11:22:31 +02:00