Re: [Rd] stopifnot() does not stop at first non-TRUE argument

2017-05-19 Thread Martin Maechler
> Suharto Anggono Suharto Anggono via R-devel > on Thu, 18 May 2017 16:27:09 + writes: >> From an example in >> http://www.uni-muenster.de/ZIV.BennoSueselbeck/s-html/helpfiles/nargs.html >> , number of arguments in '...' can be obtained by > (function(...)nargs(

[Rd] Inconsistency in handling of numeric input with %d by sprintf

2017-05-19 Thread Michael Chirico
Consider #as.numeric for emphasis sprintf('%d', as.numeric(1)) # [1] "1" vs. sprintf('%d', NA_real_) > Error in sprintf("%d", NA_real_) : invalid format '%d'; use format %f, %e, %g or %a for numeric object > I understand the error is correct, but if it works for other numeric input, why d

[Rd] Null pointer dereference?

2017-05-19 Thread Zubin Mevawalla
I was curious if this was a real null pointer dereference issue in R-devel/src/library/grDevices/src/devPS.c on line 1009? 1000: static type1fontinfo makeType1Font() 1001: { 1002: type1fontinfo font = (Type1FontInfo *) malloc(sizeof(Type1FontInfo)); 1003: /* 1004: * Initialise font->m

Re: [Rd] stopifnot() does not stop at first non-TRUE argument

2017-05-19 Thread William Dunlap via R-devel
While you are fiddling with stopifnot(), please consider changing the form of the error thrown so that it includes the caller's call. The change would be from something like stop( <> ) to stop(simpleError( <>, sys.call(-1))) For the following code f <- function(x, y) { stopifnot(x > y

Re: [Rd] Null pointer dereference?

2017-05-19 Thread Tomas Kalibera
Thanks, the tool is indeed right, this is a real error. Although it is unlikely to trigger and unlikely to cause new problems (R would fail soon anyway if out of memory), it is clearly something to be fixed and something to be classified as "true positive". I've fixed this in a way that is con

[Rd] test fails when requesting LC_CTYPE

2017-05-19 Thread Kasper Daniel Hansen
On RedHat Enterprise Linux 6, the test below fails (this is using the stock GCC 4.4.7) from R-devel r72707. LC_CTYPE is unset when I run it, but LANG=en_US.UTF-8 It also failed "yesterday" where as far as I recall the test code looked a bit different. Best, Kasper > ## Results differed by platf

Re: [Rd] test fails when requesting LC_CTYPE

2017-05-19 Thread Kasper Daniel Hansen
I rebuilt R with export LC_CTYPE=en_US.UTF-8 and the test still fail. Surprisingly, when I run R from the bin directory and execute the test code, it runs without error: > oloc <- Sys.getlocale("LC_CTYPE") > mbyte.lc <- { + if(.Platform$OS.type == "windows") + "English_United States.2