Basically revert commit
12ce2df60d16961eaa03a5aa009eeaa645e4e1cb.
http://lists.gnu.org/archive/html/bison-patches/2012-08/msg00004.html
* data/c.m4, data/glr.c, data/yacc.c (YYID): Remove.
No longer use ARGSUSED.
* src/getargs.c: Restore simpler inclusion of getopt.h (anyway, since
then we now use gnulib which certainly protects us from such issues).
# --------------------------------------------
# Without inducing a comparison warning from the compiler, check if the
# literal value LITERAL equals VALUE from table TABLE, which must have
# --------------------------------------------
# Without inducing a comparison warning from the compiler, check if the
# literal value LITERAL equals VALUE from table TABLE, which must have
-# TABLE_min and TABLE_max defined. YYID must be defined as an identity
-# function that suppresses warnings about constant conditions.
+# TABLE_min and TABLE_max defined.
m4_define([b4_table_value_equals],
[m4_if(m4_eval($3 < m4_indir([b4_]$1[_min])
|| m4_indir([b4_]$1[_max]) < $3), [1],
m4_define([b4_table_value_equals],
[m4_if(m4_eval($3 < m4_indir([b4_]$1[_min])
|| m4_indir([b4_]$1[_max]) < $3), [1],
[[((]$2[) == (]$3[))]])])
[[((]$2[) == (]$3[))]])])
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
]b4_function_define([yydestruct],
[static void],
[[const char *yymsg], [yymsg]],
]b4_function_define([yydestruct],
[static void],
[[const char *yymsg], [yymsg]],
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
]b4_function_define([yy_symbol_value_print],
[static void],
[[FILE *yyoutput], [yyoutput]],
]b4_function_define([yy_symbol_value_print],
[static void],
[[FILE *yyoutput], [yyoutput]],
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
{ \
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
{ \
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
(Current).first_column = (Current).last_column = \
YYRHSLOC (Rhs, 0).last_column; \
} \
(Current).first_column = (Current).last_column = \
YYRHSLOC (Rhs, 0).last_column; \
} \
#endif
/* Suppress unused-variable warnings by "using" E. */
#endif
/* Suppress unused-variable warnings by "using" E. */
-#if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e) /* empty */
#endif
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e) /* empty */
#endif
-/* Identity function, used to suppress warnings about constant conditions. */
-#ifndef lint
-# define YYID(n) (n)
-#else
-]b4_function_define([YYID], [static int], [[int i], [i]])[
-{
- return i;
-}
-#endif
-
#ifndef YYFREE
# define YYFREE free
#endif
#ifndef YYFREE
# define YYFREE free
#endif
YYRESULTTAG yychk_flag = YYE; \
if (yychk_flag != yyok) \
return yychk_flag; \
YYRESULTTAG yychk_flag = YYE; \
if (yychk_flag != yyok) \
return yychk_flag; \
do { \
if (yydebug) \
YYFPRINTF Args; \
do { \
if (yydebug) \
YYFPRINTF Args; \
]b4_yy_symbol_print_define[
]b4_yy_symbol_print_define[
yy_symbol_print (stderr, Type, Value]b4_locuser_args([Location])[); \
YYFPRINTF (stderr, "\n"); \
} \
yy_symbol_print (stderr, Type, Value]b4_locuser_args([Location])[); \
YYFPRINTF (stderr, "\n"); \
} \
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
do { \
if (Yystack->yyspaceLeft < YYHEADROOM) \
yyexpandGLRStack (Yystack); \
do { \
if (Yystack->yyspaceLeft < YYHEADROOM) \
yyexpandGLRStack (Yystack); \
#else
# define YY_RESERVE_GLRSTACK(Yystack) \
do { \
if (Yystack->yyspaceLeft < YYHEADROOM) \
yyMemoryExhausted (Yystack); \
#else
# define YY_RESERVE_GLRSTACK(Yystack) \
do { \
if (Yystack->yyspaceLeft < YYHEADROOM) \
yyMemoryExhausted (Yystack); \
* value ($$), and yylocp points to place for location information
* (@@$). Returns yyok for normal return, yyaccept for YYACCEPT,
* yyerr for YYERROR, yyabort for YYABORT. */
* value ($$), and yylocp points to place for location information
* (@@$). Returns yyok for normal return, yyaccept for YYACCEPT,
* yyerr for YYERROR, yyabort for YYABORT. */
-/*ARGSUSED*/ static YYRESULTTAG
yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
yyGLRStack* yystackp,
YYSTYPE* yyvalp]b4_locuser_formals[)
yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
yyGLRStack* yystackp,
YYSTYPE* yyvalp]b4_locuser_formals[)
# undef yyclearin
# undef YYRECOVERING
}
# undef yyclearin
# undef YYRECOVERING
}
-/*ARGSUSED*/ static void
yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1)
{
YYUSE (yy0);
yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1)
{
YYUSE (yy0);
do { \
if (yydebug) \
yy_reduce_print Args; \
do { \
if (yydebug) \
yy_reduce_print Args; \
/*----------------------------------------------------------------------.
| Report that stack #YYK of *YYSTACKP is going to be reduced by YYRULE. |
`----------------------------------------------------------------------*/
/*----------------------------------------------------------------------.
| Report that stack #YYK of *YYSTACKP is going to be reduced by YYRULE. |
`----------------------------------------------------------------------*/
-/*ARGSUSED*/ static inline void
yy_reduce_print (int yynormal, yyGLRStackItem* yyvsp, size_t yyk,
yyRuleNum yyrule]b4_user_formals[)
{
yy_reduce_print (int yynormal, yyGLRStackItem* yyvsp, size_t yyk,
yyRuleNum yyrule]b4_user_formals[)
{
{
yySemanticOption** yyz0p = &yys0->yysemantics.yyfirstVal;
yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal;
{
yySemanticOption** yyz0p = &yys0->yysemantics.yyfirstVal;
yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal;
{
if (yyz1 == *yyz0p || yyz1 == YY_NULL)
break;
{
if (yyz1 == *yyz0p || yyz1 == YY_NULL)
break;
-/*ARGSUSED*/ static YYRESULTTAG
yyreportAmbiguity (yySemanticOption* yyx0,
yySemanticOption* yyx1]b4_pure_formals[)
{
yyreportAmbiguity (yySemanticOption* yyx0,
yySemanticOption* yyx1]b4_pure_formals[)
{
-/*ARGSUSED*/ static void
yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
{
if (yystackp->yyerrState != 0)
yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
{
if (yystackp->yyerrState != 0)
/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP,
yylval, and yylloc are the syntactic category, semantic value, and location
of the lookahead. */
/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP,
yylval, and yylloc are the syntactic category, semantic value, and location
of the lookahead. */
-/*ARGSUSED*/ static void
yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
{
size_t yyk;
yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
{
size_t yyk;
if (yystackp->yyerrState == 3)
/* We just shifted the error token and (perhaps) took some
reductions. Skip tokens until we can proceed. */
if (yystackp->yyerrState == 3)
/* We just shifted the error token and (perhaps) took some
reductions. Skip tokens until we can proceed. */
{
yySymbol yytoken;
if (yychar == YYEOF)
{
yySymbol yytoken;
if (yychar == YYEOF)
default: \
goto yybuglab; \
} \
default: \
goto yybuglab; \
} \
/*----------.
| yyparse. |
/*----------.
| yyparse. |
yyglrShift (&yystack, 0, 0, 0, &yylval]b4_locations_if([, &yylloc])[);
yyposn = 0;
yyglrShift (&yystack, 0, 0, 0, &yylval]b4_locations_if([, &yylloc])[);
yyposn = 0;
{
/* For efficiency, we have two loops, the first of which is
specialized to deterministic operation (single stack, no
potential ambiguity). */
/* Standard mode */
{
/* For efficiency, we have two loops, the first of which is
specialized to deterministic operation (single stack, no
potential ambiguity). */
/* Standard mode */
{
yyRuleNum yyrule;
int yyaction;
{
yyRuleNum yyrule;
int yyaction;
{
yySymbol yytoken_to_shift;
size_t yys;
{
yySymbol yytoken_to_shift;
size_t yys;
yyfreeGLRStack (&yystack);
}
yyfreeGLRStack (&yystack);
}
- /* Make sure YYID is used. */
- return YYID (yyresult);
#endif
/* Suppress unused-variable warnings by "using" E. */
#endif
/* Suppress unused-variable warnings by "using" E. */
-#if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e) /* empty */
#endif
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e) /* empty */
#endif
-/* Identity function, used to suppress warnings about constant conditions. */
-#ifndef lint
-# define YYID(n) (n)
-#else
-]b4_function_define([YYID], [static int], [[int yyi], [yyi]])[
-{
- return yyi;
-}
-#endif
-
#if ]b4_lac_if([[1]], [[! defined yyoverflow || YYERROR_VERBOSE]])[
/* The parser invokes alloca or malloc; define the necessary symbols. */]dnl
#if ]b4_lac_if([[1]], [[! defined yyoverflow || YYERROR_VERBOSE]])[
/* The parser invokes alloca or malloc; define the necessary symbols. */]dnl
# ifdef YYSTACK_ALLOC
/* Pacify GCC's `empty if-body' warning. */
# ifdef YYSTACK_ALLOC
/* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# ifndef YYSTACK_ALLOC_MAXIMUM
/* The OS might guarantee only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
# ifndef YYSTACK_ALLOC_MAXIMUM
/* The OS might guarantee only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
# endif
# endif
#endif /* !YYCOPY_NEEDED */
# endif
# endif
#endif /* !YYCOPY_NEEDED */
yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \
YYERROR; \
} \
yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \
YYERROR; \
} \
do { \
if (yydebug) \
YYFPRINTF Args; \
do { \
if (yydebug) \
YYFPRINTF Args; \
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
do { \
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
do { \
Type, Value]b4_locations_if([, Location])[]b4_user_args[); \
YYFPRINTF (stderr, "\n"); \
} \
Type, Value]b4_locations_if([, Location])[]b4_user_args[); \
YYFPRINTF (stderr, "\n"); \
} \
]b4_yy_symbol_print_define[
]b4_yy_symbol_print_define[
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
/*------------------------------------------------.
/*------------------------------------------------.
do { \
if (yydebug) \
yy_reduce_print (yyssp, yyvsp, ]b4_locations_if([yylsp, ])[Rule]b4_user_args[); \
do { \
if (yydebug) \
yy_reduce_print (yyssp, yyvsp, ]b4_locations_if([yylsp, ])[Rule]b4_user_args[); \
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
/* Discard any previous initial lookahead context because of Event,
which may be a lookahead change or an invalidation of the currently
/* Discard any previous initial lookahead context because of Event,
which may be a lookahead change or an invalidation of the currently
Event "\n"); \
yy_lac_established = 0; \
} \
Event "\n"); \
yy_lac_established = 0; \
} \
#else
# define YY_LAC_DISCARD(Event) yy_lac_established = 0
#endif
#else
# define YY_LAC_DISCARD(Event) yy_lac_established = 0
#endif
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
#endif
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
#endif
- /* Make sure YYID is used. */
- return YYID (yyresult);
#include <c-strcase.h>
#include <configmake.h>
#include <error.h>
#include <c-strcase.h>
#include <configmake.h>
#include <error.h>
-
-/* Hack to get <getopt.h> to declare getopt with a prototype. */
-#if lint && ! defined __GNU_LIBRARY__
-# define __GNU_LIBRARY__
-# define HACK_FOR___GNU_LIBRARY___PROTOTYPE 1
-#endif
-
-
-#ifdef HACK_FOR___GNU_LIBRARY___PROTOTYPE
-# undef __GNU_LIBRARY__
-# undef HACK_FOR___GNU_LIBRARY___PROTOTYPE
-#endif
-
#include <progname.h>
#include "complain.h"
#include <progname.h>
#include "complain.h"