[R] compiling R-0.90.0 on alpha-dec-osf4.0

Mitsuru Oka oka at debian.or.jp
Fri Nov 26 17:44:36 CET 1999


At Fri, 26 Nov 1999 11:44:33 GMT,
Dr X Cai <caix at isdux1.bham.ac.uk> wrote:
> 
> I am compiling R-0.90.0 on alpha-dec-osf4.0 and it stops by giving the
> following message:
> 
> cc: Error: ../../../R/src/main/gram.y, line 1365: In this declaration, parameter 1 has a different type than specified in an earlier declaration of this function.
> SEXP mkString(const char *s)
> -----^
> cc: Error: ../../../R/src/main/gram.y, line 1365: In this declaration, the type of "mkString" is not compatible with the type of a previous declaration of "mkString" at line number 378 in file ../include/Rinternals.h.
> SEXP mkString(const char *s)
> -----^

It's a prank of bison. Bison generate following code.

  #ifndef __cplusplus
  #ifndef __STDC__
  #define const
  #endif
  #endif

`SEXP mkString(const char *s)' is replaced to
`SEXP mkString(char *s)' by preprocessor.
And, cc compiler is too strict to ignore the difference
bettween type `char *' and `const char *' defined in Rinternals.h.

My configure option is here:

  CC=cc CFLAGS='-O5 -I/usr/local/include -std' CPPFLAGS='-O5 -I/usr/local/include' FFLAGS='-O5' ./configure --with-f77 --with-readline

`-std' option defines __STDC__, and then compile will be successful.
--
Mitsuru Oka
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list