I have CXXFLAGS += -Wno-ignored-attributes defined in ~/.R/Makevars, so most of the warning chaff is already suppressed, but the warnings listed below (related to Rprintf/REprintf/Rf_warning) seem new and possibly worth resolving -- maybe due to changes in R-devel? (R version (unstable) (2023-11-26 r85638); TMB 1.9.7)
$ R CMD INSTALL glmmTMB
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘glmmTMB’ ...
** using staged installation
** libs
using C++ compiler: ‘g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
g++ -std=gnu++17 -I"/usr/local/lib/R/include" -DNDEBUG -DTMBAD_FRAMEWORK -I'/usr/local/lib/R/site-library/TMB/include' -I'/usr/lib/R/site-library/RcppEigen/include' -I/usr/local/include -fopenmp -fpic -g -O2 -Wno-ignored-attributes -c glmmTMB.cpp -o glmmTMB.o
In file included from /usr/local/lib/R/site-library/TMB/include/TMB.hpp:41,
from glmmTMB.cpp:1:
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp: In member function ‘std::streamsize Rstreambuf<OUTPUT>::xsputn(const char*, std::streamsize) [with bool OUTPUT = true; std::streamsize = long int]’:
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp:43:15: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 2 has type ‘std::streamsize’ {aka ‘long int’} [-Wformat=]
43 | Rprintf( "%.*s", num, s ) ;
| ~~^~ ~~~
| | |
| int std::streamsize {aka long int}
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp: In member function ‘std::streamsize Rstreambuf<OUTPUT>::xsputn(const char*, std::streamsize) [with bool OUTPUT = false; std::streamsize = long int]’:
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp:47:16: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 2 has type ‘std::streamsize’ {aka ‘long int’} [-Wformat=]
47 | REprintf( "%.*s", num, s ) ;
| ~~^~ ~~~
| | |
| int std::streamsize {aka long int}
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp: In member function ‘int Rstreambuf<OUTPUT>::overflow(int) [with bool OUTPUT = true]’:
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp:51:30: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘int*’ [-Wformat=]
51 | if (c != EOF) Rprintf( "%.1s", &c ) ;
| ~~~^ ~~
| | |
| | int*
| char*
| %.1n
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp: In member function ‘int Rstreambuf<OUTPUT>::overflow(int) [with bool OUTPUT = false]’:
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp:55:31: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘int*’ [-Wformat=]
55 | if (c != EOF) REprintf( "%.1s", &c ) ;
| ~~~^ ~~
| | |
| | int*
| char*
| %.1n
In file included from /usr/local/lib/R/site-library/TMB/include/TMB.hpp:165,
from glmmTMB.cpp:1:
/usr/local/lib/R/site-library/TMB/include/toggle_thread_safe_R.hpp: In function ‘void Ts_warning(const char*, ...)’:
/usr/local/lib/R/site-library/TMB/include/toggle_thread_safe_R.hpp:157:15: warning: format not a string literal and no format arguments [-Wformat-security]
157 | Rf_warning(x);
| ~~~~~~~~~~^~~
In file included from glmmTMB.cpp:1:
/usr/local/lib/R/site-library/TMB/include/TMB.hpp: In function ‘void eigen_REprintf(const char*)’:
/usr/local/lib/R/site-library/TMB/include/TMB.hpp:166:50: warning: format not a string literal and no format arguments [-Wformat-security]
166 | void eigen_REprintf(const char* x)CSKIP({REprintf(x);})
| ~~~~~~~~^~~
/usr/local/lib/R/site-library/TMB/include/TMB.hpp:25:20: note: in definition of macro ‘CSKIP’
25 | #define CSKIP(...) __VA_ARGS__
| ^~~~~~~~~~~
In file included from /usr/local/lib/R/site-library/TMB/include/TMB.hpp:202,
from glmmTMB.cpp:1:
/usr/local/lib/R/site-library/TMB/include/tmb_core.hpp: In function ‘SEXPREC* tmbad_print(SEXP, SEXP)’:
/usr/local/lib/R/site-library/TMB/include/tmb_core.hpp:1963:16: warning: too many arguments for format [-Wformat-extra-args]
1963 | Rf_error("Unknown method: ", method.c_str());
| ^~~~~~~~~~~~~~~~~~
^Cmake: *** [/usr/local/lib/R/etc/Makeconf:200: glmmTMB.o] Interrupt
ERROR: compilation failed for package ‘glmmTMB’
* removing ‘/usr/local/lib/R/site-library/glmmTMB’
* restoring previous ‘/usr/local/lib/R/site-library/glmmTMB’
bolker@pop-os:~/R/pkgs/glmmTMB$ R CMD INSTALL glmmTMB
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘glmmTMB’ ...
** using staged installation
** libs
using C++ compiler: ‘g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
g++ -std=gnu++17 -I"/usr/local/lib/R/include" -DNDEBUG -DTMBAD_FRAMEWORK -I'/usr/local/lib/R/site-library/TMB/include' -I'/usr/lib/R/site-library/RcppEigen/include' -I/usr/local/include -fopenmp -fpic -g -O2 -Wno-ignored-attributes -c glmmTMB.cpp -o glmmTMB.o
In file included from /usr/local/lib/R/site-library/TMB/include/TMB.hpp:41,
from glmmTMB.cpp:1:
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp: In member function ‘std::streamsize Rstreambuf<OUTPUT>::xsputn(const char*, std::streamsize) [with bool OUTPUT = true; std::streamsize = long int]’:
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp:43:15: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 2 has type ‘std::streamsize’ {aka ‘long int’} [-Wformat=]
43 | Rprintf( "%.*s", num, s ) ;
| ~~^~ ~~~
| | |
| int std::streamsize {aka long int}
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp: In member function ‘std::streamsize Rstreambuf<OUTPUT>::xsputn(const char*, std::streamsize) [with bool OUTPUT = false; std::streamsize = long int]’:
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp:47:16: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 2 has type ‘std::streamsize’ {aka ‘long int’} [-Wformat=]
47 | REprintf( "%.*s", num, s ) ;
| ~~^~ ~~~
| | |
| int std::streamsize {aka long int}
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp: In member function ‘int Rstreambuf<OUTPUT>::overflow(int) [with bool OUTPUT = true]’:
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp:51:30: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘int*’ [-Wformat=]
51 | if (c != EOF) Rprintf( "%.1s", &c ) ;
| ~~~^ ~~
| | |
| | int*
| char*
| %.1n
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp: In member function ‘int Rstreambuf<OUTPUT>::overflow(int) [with bool OUTPUT = false]’:
/usr/local/lib/R/site-library/TMB/include/Rstream.hpp:55:31: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘int*’ [-Wformat=]
55 | if (c != EOF) REprintf( "%.1s", &c ) ;
| ~~~^ ~~
| | |
| | int*
| char*
| %.1n
In file included from /usr/local/lib/R/site-library/TMB/include/TMB.hpp:165,
from glmmTMB.cpp:1:
/usr/local/lib/R/site-library/TMB/include/toggle_thread_safe_R.hpp: In function ‘void Ts_warning(const char*, ...)’:
/usr/local/lib/R/site-library/TMB/include/toggle_thread_safe_R.hpp:157:15: warning: format not a string literal and no format arguments [-Wformat-security]
157 | Rf_warning(x);
| ~~~~~~~~~~^~~
In file included from glmmTMB.cpp:1:
/usr/local/lib/R/site-library/TMB/include/TMB.hpp: In function ‘void eigen_REprintf(const char*)’:
/usr/local/lib/R/site-library/TMB/include/TMB.hpp:166:50: warning: format not a string literal and no format arguments [-Wformat-security]
166 | void eigen_REprintf(const char* x)CSKIP({REprintf(x);})
| ~~~~~~~~^~~
/usr/local/lib/R/site-library/TMB/include/TMB.hpp:25:20: note: in definition of macro ‘CSKIP’
25 | #define CSKIP(...) __VA_ARGS__
| ^~~~~~~~~~~
In file included from /usr/local/lib/R/site-library/TMB/include/TMB.hpp:202,
from glmmTMB.cpp:1:
/usr/local/lib/R/site-library/TMB/include/tmb_core.hpp: In function ‘SEXPREC* tmbad_print(SEXP, SEXP)’:
/usr/local/lib/R/site-library/TMB/include/tmb_core.hpp:1963:16: warning: too many arguments for format [-Wformat-extra-args]
1963 | Rf_error("Unknown method: ", method.c_str());
| ^~~~~~~~~~~~~~~~~~
g++ -std=gnu++17 -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o glmmTMB.so glmmTMB.o utils.o -fopenmp -L/usr/local/lib/R/lib -lR
"/usr/local/lib/R/bin/Rscript" -e "cat(as.character(packageVersion('TMB')), '\n', sep="", file='../inst/TMB-version')"
"/usr/local/lib/R/bin/Rscript" -e "cat(as.character(packageVersion('Matrix')), '\n', sep="", file='../inst/Matrix-version')"
installing to /usr/local/lib/R/site-library/00LOCK-glmmTMB/00new/glmmTMB/libs
** R
I have
CXXFLAGS += -Wno-ignored-attributes
defined in~/.R/Makevars
, so most of the warning chaff is already suppressed, but the warnings listed below (related toRprintf
/REprintf
/Rf_warning
) seem new and possibly worth resolving -- maybe due to changes in R-devel? (R version (unstable) (2023-11-26 r85638); TMB 1.9.7)