From ntakebay@bio.indiana.edu  Mon Apr  9 19:07:48 2001
From: ntakebay@bio.indiana.edu (ntakebay@bio.indiana.edu)
Date: Mon, 9 Apr 2001 20:07:48 +0200 (MET DST)
Subject: [Rd] syntax error in datetime.c (PR#901)
Message-ID: <200104091807.UAA14215@pubhealth.ku.dk>

Full_Name: Naoki Takebayashi
Version: 1.2.2
OS: Linux, RedHat 7.0/alpha
Submission from: (NULL) (152.3.12.123)


With RedHat 7.0/alpha (gcc 2.96-69), I encountered following error:

gcc -I. -I../../src/include -I../../src/include -I/usr/local/include
-DHAVE_CONFIG_H -mieee  -O2 -mieee -c datetime.c -o datetime.o
datetime.c: In function `do_systime':
datetime.c:306: parse error before `ans'
datetime.c:307: `ans' undeclared (first use in this function)
datetime.c:307: (Each undeclared identifier is reported only once
datetime.c:307: for each function it appears in.)
make[3]: *** [datetime.o] Error 1
make[3]: Leaving directory `/usr/src/redhat/BUILD/R-1.2.2/src/main'

Following patch fixes this syntax error.

--- R-1.2.2/src/main/datetime.c.orig	Mon Apr  9 11:24:14 2001
+++ R-1.2.2/src/main/datetime.c	Mon Apr  9 11:25:11 2001
@@ -300,10 +300,10 @@
 SEXP do_systime(SEXP call, SEXP op, SEXP args, SEXP env)
 {
     time_t res = time(NULL);
+    SEXP ans = allocVector(REALSXP, 1);
 #ifdef USING_LEAPSECONDS
     res -= 22;
 #endif
-    SEXP ans = allocVector(REALSXP, 1);
     if(res != (time_t)(-1)) REAL(ans)[0] = (double) res;
     else REAL(ans)[0] = NA_REAL;
     return ans;


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] syntax error in datetime.c (PR#901)
ntakebay@bio.indiana.edu