paleolimbot / narrow

An R interface to the 'Apache Arrow' C API
https://paleolimbot.github.io/narrow/
Other
30 stars 3 forks source link

Minor compiler warnings #3

Closed eddelbuettel closed 2 years ago

eddelbuettel commented 2 years ago

Thanks for putting this together -- I've been on-and-off following under the different names it had over the last few months.

One thing I noticed, and which may be due to my use off gcc / g++ (now at -10 or -11) with you presumably using clang+= is that I get two nuisance warnings. They are easy to fix and I would be happy to send you a PR:

That's all, and I don't mean to intrude or trample of your feet but you appear to be a rather careful coder so maybe you'd value two fewer warnings.

paleolimbot commented 2 years ago

I just tried to replicate using the ubuntu/focal docker image but it looks like that's only GCC 9, so if it's easy for you to fix that would be fastest (or give me a docker incantation with the right GCC and I'm happy to do it). The guts of that C API will probably be rewritten but I do like to keep the build clean as I go.

I've been poking away at this to find the level of minimal that still provides utility. I'm hoping to settle on a scope with the help of the Arrow dev mailing list in the next month or so. PRs or suggestions that help solidify the scope are welcome anytime!

eddelbuettel commented 2 years ago

FWIW I am on Ubuntu 21.04 (and overdue an update to 21.10) on my normal workstation but you should be able to replicate what I do here with the r-base Docker container I maintain (as rocker/r-base, co-listed as r-base) which has Debian testing.

[ So I tried ... ]

Turns out I only get the first of two when I add -Wall -pendantic; I do not get the second one. Odd. It must be something in my ~/.R/Makevars. So this is likely not something to really worry about. For what it is worth on my system it looks like

edd@rob:~/git/narrow(master)$ install.r         # that's a wrapper from littler
* installing *source* package found in current working directory ...
* installing *source* package ‘narrow’ ...
** using staged installation
** libs
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c array-data.c -o array-data.o                                   
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c array-stream-carrow-array.c -o array-stream-carrow-array.o
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c array-stream-function.c -o array-stream-function.o                               
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c array-stream-wrapper.c -o array-stream-wrapper.o
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c array-stream.c -o array-stream.o
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c array.c -o array.o      
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c bitmask.c -o bitmask.o
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c cast-from-array.c -o cast-from-array.o
cast-from-array.c: In function ‘narrow_c_character_from_array’:                                                                                                                                                    cast-from-array.c:199:9: warning: variable ‘double_copy_result’ set but not used [-Wunused-but-set-variable]                                                            
  199 |     int double_copy_result;                                                                      
      |         ^~~~~~~~~~~~~~~~~~
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c cast-to-array.c -o cast-to-array.o
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c copy.c -o copy.o
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c init.c -o init.o
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c int64.c -o int64.o
ccache g++-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -c narrow-cpp-impl.cc -o narrow-cpp-impl.o
In file included from narrow/narrow-cpp.cc:2,
                 from narrow-cpp-impl.cc:2:                                                              
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = signed char; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here                                                            
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
   67 |   for (uint64_t i = 0; i < n_elements; i++) {
      |                        ~~^~~~~~~~~~~~                                                                                                                                                                      
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = unsigned char; int64_t = long int]’:
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = unsigned char; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = short int; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = short unsigned int; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = int; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = unsigned int; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = long int; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = long unsigned int; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = float; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = double; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c narrow-impl.c -o narrow-impl.o
ccache g++-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -c pointers-cpp.cc -o pointers-cpp.o
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c pointers.c -o pointers.o
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c schema.c -o schema.o
ccache gcc-11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -c util.c -o util.o
ccache g++-11 -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -flto=auto -Wl,-z,relro -o narrow.so array-data.o array-stream-carrow-array.o array-stream-function.o array-stream-wrapper.o array-stream.o array.o bitmask.o cast-from-array.o cast-to-array.o copy.o init.o int64.o narrow-cpp-impl.o narrow-impl.o pointers-cpp.o pointers.o schema.o util.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-narrow/00new/narrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (narrow)
edd@rob:~/git/narrow(master)$ 

And while noisy, it's harmless. I have the branch here I can send you a very minor PR or we can just fold it.

No suggestion for scope, really. What you have is already lovely as it build on the otherwise very bare C API I have been using (very lightly) in one place. Having this (on CRAN, hint, hint) would help so thanks again for putting it together.

eddelbuettel commented 2 years ago

Ok, that became a cute puzzle as my ~/.R/Makevars has of course accumulated things. I overlooked the second file is C++. So a minimal reproducing example is to fire up r-base in Docker and set PKG_CFLAGS and PKG_CXXFLAGS to -Wall -pedantic:

edd@rob:~/git/narrow(master)$ docker run --rm -ti -v $PWD:/here -w /here r-base bash
root@a54c8a6222cc:/here# PKG_CFLAGS='-Wall -pedantic' PKG_CXXFLAGS='-Wall -pedantic' R CMD INSTALL . 
* installing to library ‘/usr/local/lib/R/site-library’                                                  
* installing *source* package ‘narrow’ ...                                                                                                                                                                         
** using staged installation                                                                                                                                                                                       
** libs                                      
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdat
e-time -D_FORTIFY_SOURCE=2 -g  -c array-data.c -o array-data.o                                                                                                                                                     
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdat
e-time -D_FORTIFY_SOURCE=2 -g  -c array-stream-carrow-array.c -o array-stream-carrow-array.o                                                                                                                       
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdat
e-time -D_FORTIFY_SOURCE=2 -g  -c array-stream-function.c -o array-stream-function.o                     
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdat
e-time -D_FORTIFY_SOURCE=2 -g  -c array-stream-wrapper.c -o array-stream-wrapper.o                                                                                                                                 
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdat
e-time -D_FORTIFY_SOURCE=2 -g  -c array-stream.c -o array-stream.o                                                                                                                                                 
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdat
e-time -D_FORTIFY_SOURCE=2 -g  -c array.c -o array.o                                                     
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdat
e-time -D_FORTIFY_SOURCE=2 -g  -c bitmask.c -o bitmask.o                                                                                                                                                           
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdat
e-time -D_FORTIFY_SOURCE=2 -g  -c cast-from-array.c -o cast-from-array.o                                                                                                                                           
cast-from-array.c: In function ‘narrow_c_character_from_array’:                                                                                                                                                    cast-from-array.c:199:9: warning: variable ‘double_copy_result’ set but not used [-Wunused-but-set-variable]                                                                                                       
  199 |     int double_copy_result;                                                                                                                                                                                      |         ^~~~~~~~~~~~~~~~~~                                                                       
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c cast-to-array.c -o cast-to-array.o
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c copy.c -o copy.o                                                       
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c int64.c -o int64.o                                                                                                                                                               
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D
_FORTIFY_SOURCE=2 -g  -c narrow-cpp-impl.cc -o narrow-cpp-impl.o                                         
In file included from narrow/narrow-cpp.cc:2,
                 from narrow-cpp-impl.cc:2:                                                              
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = signed char; int64_t = long int]’:                                                
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]                                   
   67 |   for (uint64_t i = 0; i < n_elements; i++) {                                                    
      |                        ~~^~~~~~~~~~~~                                                            
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = unsigned char; int64_t = long int]’:                                              
narrow/buffer.cc:116:26:   required from here                                                            
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]                                   
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = short int; int64_t = long int]’:                       
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = short unsigned int; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = int; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = unsigned int; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = long int; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = long unsigned int; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = float; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
narrow/buffer.cc: In instantiation of ‘int static_copy_template_to_bool(void*, const void*, int64_t, int64_t) [with src_type_t = double; int64_t = long int]’:
narrow/buffer.cc:116:26:   required from here
narrow/buffer.cc:67:26: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c narrow-impl.c -o narrow-impl.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c pointers-cpp.cc -o pointers-cpp.o
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c pointers.c -o pointers.o
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c schema.c -o schema.o
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG     -Wall -pedantic -fpic  -g -O2 -ffile-prefix-map=/build/r-base-PT7Nxy/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c util.c -o util.o
g++ -std=gnu++14 -shared -L/usr/lib/R/lib -Wl,-z,relro -o narrow.so array-data.o array-stream-carrow-array.o array-stream-function.o array-stream-wrapper.o array-stream.o array.o bitmask.o cast-from-array.o cast-to-array.o copy.o init.o int64.o narrow-cpp-impl.o narrow-impl.o pointers-cpp.o pointers.o schema.o util.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-here/00new/narrow/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (narrow)
root@a54c8a6222cc:/here# 

Happy to shoot over a PR.

eddelbuettel commented 2 years ago

For completeness, once it became that it is was just a matter of setting the C and C++ flags to -Wall -pedantic it also become reproducible under (any ?) gcc and g++ combination -- as e.g. under Ubuntu 20.04 LTS with the 9.3.0 builds of the compiler toolchain.

paleolimbot commented 2 years ago

Thanks for the logs and tracking down -Wall -pedantic! It's a bit of a mess but I reproduced with:

docker run --rm -it -v $(pwd):/pkg rocker/r-base R -e 'install.packages("withr"); withr::with_makevars(list(CFLAGS = "-Wall -pedantic", CXXFLAGS = "-Wall -pedantic"), system("R CMD INSTALL /pkg --preclean"))'

I was totally happy to fix this...also happy to take unsolicited PRs anytime!

eddelbuettel commented 2 years ago

It's really mostly a nothingburger but over the years CRAN and CRAN Policies got to me so I have expanded flags in ~/.R/Makevars (plus, of course, the all-import use of ccache which kidding aside really helps) so the nags are a little annoying. I'll check my branch here and rebase if needed and will send you that 'unsolicited' PR :) Feel free to ignore or not, it really is not affecting behaviour or design.

Edit: And I see you took care of it -- so thanks!