Re: [R-pkg-devel] clang issue

2023-08-07 Thread Dirk Eddelbuettel


Daniel,

This is not new, and not related to clang.

On 7 August 2023 at 12:58, Grose, Daniel wrote:
| Any ideas ?

Add a line

   #define R_NO_REMAP 1

before _any_ inclusion of R headers. See Section 6 of Writing R Extensions.

If you use eg Rcpp it is done for you when you include Rcpp headers.

Cheers, Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] clang issue

2023-08-07 Thread Grose, Daniel
Hi

My package submission fails due to 



In file included from MeanAnomalyMV.cpp:7:
In file included from ./Functions_mean.h:4:
In file included from usr/local/clang-trunk/bin../include/c++/v1/vector:321:
In file included from
usr/local/clang-trunk/bin../include/c++/v1/__format/formatter_bool.h:20:
In file included from
usr/local/clang-trunk/bin../include/c++/v1/__format/formatter_integral.h:32:
In file included from usr/local/clang-trunk/bin../include/c++/v1/locale:202:
usr/local/clang-trunk/bin../include/c++/v1/__locale:962:34: error: too
many arguments provided to function-like macro invocation
   962 | int length(state_type& __st, const extern_type* __frm,
const extern_type* __end, size_t __mx) const
   |  ^
/data/gannet/ripley/R/R-flang/include/Rinternals.h:968:9: note: macro
'length' defined here
   968 | #define length(x)   Rf_length(x)
   | ^
...

Please define R_NO_REMAP and fix the fallout: it has Rinternals.h
included all over the place in both .h and .cpp files.  It must not be
included before  nor any other C++ header.

Please fix and resubmit.



I have tried to reproduce the error using clang-15 on Ubuntu-22.04, but 
everything seems fine --

 clang-15 -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG 
-DBOOST_ALLOW_DEPRECATED_HEADERS -DR_NO_REMAP 
-I'/home/grosedj/R-packages/Rcpp/include' 
-I'/home/grosedj/R-packages/BH/include'-fpic  -g -O2 
-fdebug-prefix-map=/build/r-base-a3XuZ5/r-base-4.2.2.20221110=. 
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
-D_FORTIFY_SOURCE=2  -c MeanAnomalyMV.cpp -o MeanAnomalyMV.o


Any ideas ?

Many thanks,

Daniel Grose




[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel