mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 00:03:03 +00:00
tests: avoid compiler warnings
* tests/calc.at (AT_CALC_MAIN): Declare yyparse and operator<< in an unnamed namespace to avoid "not declared" warnings (clang -Weverything). Remove useless prototypes.
This commit is contained in:
@@ -49,15 +49,18 @@ m4_pushdef([AT_CALC_MAIN],
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
AT_SKEL_CC_IF([[
|
AT_SKEL_CC_IF([[
|
||||||
/* A C++ ]AT_NAME_PREFIX[parse that simulates the C signature. */
|
namespace
|
||||||
int
|
|
||||||
]AT_NAME_PREFIX[parse (]AT_PARAM_IF([semantic_value *result, int *count]))[
|
|
||||||
{
|
{
|
||||||
]AT_NAME_PREFIX[::parser parser]AT_PARAM_IF([ (result, count)])[;
|
/* A C++ ]AT_NAME_PREFIX[parse that simulates the C signature. */
|
||||||
#if ]AT_API_PREFIX[DEBUG
|
int
|
||||||
parser.set_debug_level (1);
|
]AT_NAME_PREFIX[parse (]AT_PARAM_IF([semantic_value *result, int *count]))[
|
||||||
#endif
|
{
|
||||||
return parser.parse ();
|
]AT_NAME_PREFIX[::parser parser]AT_PARAM_IF([ (result, count)])[;
|
||||||
|
#if ]AT_API_PREFIX[DEBUG
|
||||||
|
parser.set_debug_level (1);
|
||||||
|
#endif
|
||||||
|
return parser.parse ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]])[
|
]])[
|
||||||
|
|
||||||
@@ -105,8 +108,6 @@ m4_pushdef([AT_CALC_LEX],
|
|||||||
[[#include <ctype.h>
|
[[#include <ctype.h>
|
||||||
|
|
||||||
]AT_YYLEX_DECLARE_EXTERN[
|
]AT_YYLEX_DECLARE_EXTERN[
|
||||||
static int get_char (]AT_YYLEX_FORMALS[);
|
|
||||||
static void unget_char (]AT_YYLEX_PRE_FORMALS[ int c);
|
|
||||||
|
|
||||||
]AT_LOCATION_IF([
|
]AT_LOCATION_IF([
|
||||||
static AT_YYLTYPE last_yylloc;
|
static AT_YYLTYPE last_yylloc;
|
||||||
@@ -322,7 +323,7 @@ exp:
|
|||||||
;
|
;
|
||||||
%%
|
%%
|
||||||
|
|
||||||
static int
|
int
|
||||||
power (int base, int exponent)
|
power (int base, int exponent)
|
||||||
{
|
{
|
||||||
int res = 1;
|
int res = 1;
|
||||||
@@ -334,6 +335,8 @@ power (int base, int exponent)
|
|||||||
|
|
||||||
]AT_SKEL_CC_IF(
|
]AT_SKEL_CC_IF(
|
||||||
[AT_LOCATION_TYPE_IF([[
|
[AT_LOCATION_TYPE_IF([[
|
||||||
|
namespace
|
||||||
|
{
|
||||||
std::ostream&
|
std::ostream&
|
||||||
operator<< (std::ostream& o, const Span& s)
|
operator<< (std::ostream& o, const Span& s)
|
||||||
{
|
{
|
||||||
@@ -344,6 +347,7 @@ power (int base, int exponent)
|
|||||||
o << '-' << s.last.c - 1;
|
o << '-' << s.last.c - 1;
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
]])])[
|
]])])[
|
||||||
]AT_YYERROR_DEFINE[
|
]AT_YYERROR_DEFINE[
|
||||||
]AT_DEFINES_IF([],
|
]AT_DEFINES_IF([],
|
||||||
|
|||||||
Reference in New Issue
Block a user