[Rd] "warning: assignment discards qualifiers from pointer target type"

From: oliver <oliver_at_first.in-berlin.de>
Date: Tue, 07 Jun 2011 15:08:54 +0200

Hello,

following an advice here from the list I looked into sources of other packages (xts) and found the TYPEOF() macro/function, which really is helpful.

I iused the follwong code snippet:

  switch( TYPEOF( filename_sexp ) )
  {

        case STRSXP: filename = CHAR( STRING_ELT(filename_sexp, 0) );
                     break;

        default:     error("filename argument must be a string");
                     break;

  }

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 String-Expression.

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?

Ciao,

   Oliver



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue 07 Jun 2011 - 13:21:15 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 07 Jun 2011 - 15:00:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive