Displaying 3 results from an estimated 3 matches for "mkxxx_safe".
2016 May 25
3
Suggestion: mkString(NULL) should be NA
...don't do that" (pass a null pointer), which was
perfectly fine. The real issue was not the behavior but that it was not
documented or consistent. I've lived by the mantra since that you can never
trust a pointer in R code. User must always check for NULL.
I just wrote my own functions mkXXX_safe that wrap the internals and check
the pointer.
THK
http://www.keittlab.org/
[[alternative HTML version deleted]]
2016 May 25
0
Suggestion: mkString(NULL) should be NA
...e sure you don't do that.
I wouldn't object to mkXXX checking for NULL and signaling an error
instead of segfaulting, but good C code calling mkXXX should still
typically do its own check and handle the situation in an appropriate
way.
Best,
luke
>
> I just wrote my own functions mkXXX_safe that wrap the internals and check
> the pointer.
>
> THK
>
> http://www.keittlab.org/
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel...
2016 May 25
2
Suggestion: mkString(NULL) should be NA
On Wed, May 25, 2016 at 12:31 PM, Martin Maechler
<maechler at stat.math.ethz.ch> wrote:
> Better than segfaulting, yes, but really agree with Bill (and
> Gabe), also for Rf_mkChar(NULL):
> I think both functions should give an error in such a case
> rather than returning NA_character_
>
> It is an accident of some kind if they got NULL, no?
Not necessarily. A char* of