[Rd] "warning: assignment discards qualifiers from pointer target type"
oliver at first.in-berlin.de
Tue Jun 7 15:08:54 CEST 2011
following an advice here from the list I looked into sources of other
packages (xts) and found the TYPEOF() macro/function, which really is
I iused the follwong code snippet:
switch( TYPEOF( filename_sexp ) )
case STRSXP: filename = CHAR( STRING_ELT(filename_sexp, 0) );
default: error("filename argument must be a string");
Here, filename is of type char*
and one function opens a file with that name.
So it is purely intended to just grab out the char* from the
Am I doing something wrong here, or is it ok, but I have somehow
to say the extracting macros/functions, that it is really intended
to throw away information and that a warning is not necessary?
More information about the R-devel