summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-01-06 23:53:33 +0000
committerJim Meyering <jim@meyering.net>1998-01-06 23:53:33 +0000
commit0fdd1b9130824596e32edf6b0a2b8d97037cecdf (patch)
tree80dddcbf554b68fe57a2eb136a0e4af980e72e5e /lib
parentf19ca6fe2983bd9be75ad949f14309822a66b654 (diff)
downloadcoreutils-0fdd1b9130824596e32edf6b0a2b8d97037cecdf.tar.xz
Add %expect directive.
Move inclusion of getdate.h and dependent extern declarations down so getdate.h's prototype follows the sometimes-enabled definition of `const' to nothing. Otherwise, the prototype wouldn't match the definition because of the defined-away `const'. (get_date): ANSI-fy definition. From Kaveh Ghazi.
Diffstat (limited to 'lib')
-rw-r--r--lib/getdate.y24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/getdate.y b/lib/getdate.y
index 44f2e19c2..df9614f1f 100644
--- a/lib/getdate.y
+++ b/lib/getdate.y
@@ -5,8 +5,6 @@
** a couple of people on Usenet. Completely overhauled by Rich $alz
** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990.
**
-** This grammar has 13 shift/reduce conflicts.
-**
** This code is in the public domain and has no copyright.
*/
@@ -51,8 +49,6 @@
host does not conform to Posix. */
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
-#include "getdate.h"
-
#if defined (STDC_HEADERS) || defined (USG)
# include <string.h>
#endif
@@ -64,10 +60,6 @@
# define bcopy(from, to, len) memcpy ((to), (from), (len))
#endif
-extern struct tm *gmtime ();
-extern struct tm *localtime ();
-extern time_t mktime ();
-
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
as well as gratuitiously global symbol names, so we can have multiple
yacc generated parsers in the same program. Note that these are only
@@ -172,6 +164,9 @@ static int yyRelYear;
%}
+/* This grammar has 13 shift/reduce conflicts. */
+%expect 13
+
%union {
int Number;
enum _MERIDIAN Meridian;
@@ -441,6 +436,15 @@ o_merid : /* NULL */
%%
+/* Include this file down here because bison inserts code above which
+ may define-away `const'. We want the prototype for get_date to have
+ the same signature as the function definition does. */
+#include "getdate.h"
+
+extern struct tm *gmtime ();
+extern struct tm *localtime ();
+extern time_t mktime ();
+
/* Month and day table. */
static TABLE const MonthDayTable[] = {
{ "january", tMONTH, 1 },
@@ -886,9 +890,7 @@ difftm (a, b)
}
time_t
-get_date (p, now)
- const char *p;
- const time_t *now;
+get_date (const char *p, const time_t *now)
{
struct tm tm, tm0, *tmp;
time_t Start;