[Rcpp-devel] Couple of minor fixes to Rcpp

Dominick Samperi djsamperi at gmail.com
Mon Oct 25 23:35:06 CEST 2010


On Wed, Oct 20, 2010 at 5:31 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> Hi Karl,
>
> Thanks for spotting and fixing those. Out of curiousity, which non-gcc
> compiler was that?  icc ?
>
> On 20 October 2010 at 14:22, Karl Millar wrote:
> | This patch fixes a couple of minor issues.  Both are cases of illegal C++
> | code caught by using a non-gcc complier.  The first is a bug in
> | Vector::fill_dispatch, which would be serious except that the function
> | appears to be unused at the moment.  The second is just a syntactic
> issue.
> |
> | The patch is against the current svn repository.
>
> Super. We will apply those shortly; I also found another thinko of ours so
> maybe we'll just toss out 0.8.8 in due course.
>
> Thanks,  Dirk
>
> | Thanks,
> |
> | Karl Millar
> |
> | ----------------------------------------------------------------------
> | Index: Rcpp/inst/include/Rcpp/vector/Vector.h
> | ===================================================================
> | --- Rcpp/inst/include/Rcpp/vector/Vector.h    (revision 2347)
> | +++ Rcpp/inst/include/Rcpp/vector/Vector.h    (working copy)
> | @@ -311,7 +311,7 @@
> |               // when this is not trivial, this is SEXP
> |               SEXP elem = PROTECT( converter_type::get( u ) );
> |               iterator it(begin());
> | -             for( int i=0; i<size ; i++, ++it){
> | +             for( int i=0; i<size() ; i++, ++it){
> |                       *it = ::Rf_duplicate( elem ) ;
> |               }
> |               UNPROTECT(1) ; /* elem */
> | Index: Rcpp/inst/include/Rcpp/XPtr.h
> | ===================================================================
> | --- Rcpp/inst/include/Rcpp/XPtr.h     (revision 2347)
> | +++ Rcpp/inst/include/Rcpp/XPtr.h     (working copy)
> | @@ -59,7 +59,8 @@
> |       *        so you need to make sure the pointer can be "delete" d
> |       *        this way (has to be a C++ object)
> |       */
> | -    explicit XPtr(T* p, bool set_delete_finalizer, SEXP tag, SEXP prot);
> | +    explicit XPtr(T* p, bool set_delete_finalizer = true, SEXP tag =
> R_NilValue,
> | +                  SEXP prot = R_NilValue);
>

This patch was previously submitted (as part of the Windows compatibility)
and
was later removed. Note that there is an issue here in that GCC does not
always agree with "non-gcc" compilers on the interpretation of this code.
You may have to ifdef the change.

Dominick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20101025/39d336de/attachment.htm>


More information about the Rcpp-devel mailing list