albrecht.gebhardt@uni-klu.ac.at
2000-Feb-08 10:29 UTC
[Rd] problem with va_list type (alpha) (PR#421)
Full_Name: Albrecht Gebhardt Version: 0.99.0 OS: alpha, osf4.0 Submission from: (NULL) (143.205.180.40) Both DEC cc and gcc complain (osf4.0, alpha) about applying an unary operator (!) to a non scalar type (va_list arg) in printutils.c I'm not sure if I understood what was intended by "!arg" (see below), but with this patch I at least was able to compile. (and R runs now, but I guess only because I didn't came across this code section) --- ./src/main/printutils.c.va_list.patch Mon Feb 7 15:08:14 2000 +++ ./src/main/printutils.c Mon Feb 7 15:52:54 2000 @@ -421,7 +421,7 @@ else { char buf[BUFSIZE], *p = buf, *vmax = vmaxget(); int slen, res; - if(!arg) { + if(&arg!=NULL) { /* just a string, so length is known */ if((slen = strlen(format)) >= BUFSIZE) p = R_alloc(slen+1, sizeof(char)); -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
albrecht.gebhardt@uni-klu.ac.at writes:> I'm not sure if I understood what was intended by "!arg" (see below), > but with this patch I at least was able to compile. (and R runs now, > but I guess only because I didn't came across this code section) > > > --- ./src/main/printutils.c.va_list.patch Mon Feb 7 15:08:14 2000 > +++ ./src/main/printutils.c Mon Feb 7 15:52:54 2000 > @@ -421,7 +421,7 @@ > else { > char buf[BUFSIZE], *p = buf, *vmax = vmaxget(); > int slen, res; > - if(!arg) { > + if(&arg!=NULL) { > /* just a string, so length is known */ > if((slen = strlen(format)) >= BUFSIZE) > p = R_alloc(slen+1, sizeof(char));Not going to work, "if (0)" will (i.e. always take else branch). And please check for similar reports before filing a new one, we discussed this at some length earlier today! -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._