[Rd] Warnings created during R_eval or R_tryEval not shown before R ending or R error.

Laurent Gautier |g@ut|er @end|ng |rom gm@||@com
Sun Apr 23 19:33:16 CEST 2023


Hi,

I have an embedded R, with the evaluation of expressions happening over
time during the lifespan of the process. I tried either `R_eval()`  and
`R_tryEval()` for the evaluation. The issue I have is that the processing
of warnings does not happen until the process exits and/or R is shut down.
Evaluating `warnings()` returns NULL (NILSXP).

It seems like the warnings are stuck in a list out of `warnings()`'s reach,
waiting to be processed. I cannot seem to find why or how to force that to
happen. The embedded R is interactive (R_Interactive is 1).

Moreover, when the evaluation of another R expression after the warnings
results in an R error I get the error message shown followed by pending
warnings.  When tracing what happens during an error I found that
verrorcall_dflt() in src/main/errors.c calls PrintWarnings(). That function
is not part of R's C-API though.

Would anyone have a suggestion about what I am missing?

Best,


Laurent

	[[alternative HTML version deleted]]



More information about the R-devel mailing list