mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
examples: remove useless includes
* examples/c++/variant-11.yy, examples/c++/variant.yy: here. Fix warning when storing a long into an int.
This commit is contained in:
@@ -37,9 +37,8 @@
|
||||
|
||||
%code // *.cc
|
||||
{
|
||||
#include <algorithm>
|
||||
#include <climits> // INT_MIN, INT_MAX
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
#include <sstream>
|
||||
|
||||
namespace yy
|
||||
@@ -141,7 +140,10 @@ int
|
||||
main (int argc, const char *argv[])
|
||||
{
|
||||
if (2 <= argc && isdigit (*argv[1]))
|
||||
max = strtol (argv[1], nullptr, 10);
|
||||
{
|
||||
auto maxl = strtol (argv[1], nullptr, 10);
|
||||
max = INT_MIN <= maxl && maxl <= INT_MAX ? int(maxl) : 4;
|
||||
}
|
||||
auto&& p = yy::parser{};
|
||||
p.set_debug_level (!!getenv ("YYDEBUG"));
|
||||
return p.parse ();
|
||||
|
||||
Reference in New Issue
Block a user