Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues from ubuntu-rchk #276

Open
richfitz opened this issue Sep 30, 2021 · 1 comment
Open

Issues from ubuntu-rchk #276

richfitz opened this issue Sep 30, 2021 · 1 comment

Comments

@richfitz
Copy link
Member

Every file creates this compiler warning, which I don't see, but CRAN may:

   In file included from walk.cpp:64:
   In file included from ../inst/include/dust/interface.hpp:14:
   ../inst/include/dust/rng_interface.hpp:28:43: warning: implicit conversion from 'std::__1::numeric_limits<unsigned long>::type' (aka 'unsigned long') to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Wimplicit-int-float-conversion]
         std::ceil(std::abs(::unif_rand()) * std::numeric_limits<size_t>::max());
                                           ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ../inst/include/dust/rng_interface.hpp:28:43: warning: implicit conversion from 'std::__1::numeric_limits<unsigned long>::type' (aka 'unsigned long') to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Wimplicit-int-float-conversion]
         std::ceil(std::abs(::unif_rand()) * std::numeric_limits<size_t>::max());
                                           ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ../inst/include/dust/interface.hpp:43:22: note: in instantiation of function template specialization 'dust::interface::as_rng_seed<double>' requested here
       dust::interface::as_rng_seed<typename T::real_t>(r_seed);
                        ^
   walk.cpp:113:19: note: in instantiation of function template specialization 'dust::r::dust_alloc<walk>' requested here
     return dust::r::dust_alloc<walk>(r_pars, pars_multi, step, r_n_particles,
                     ^
   2 warnings generated.
   In file included from walk.cpp:64:
   In file included from ../inst/include/dust/interface.hpp:14:
   ../inst/include/dust/rng_interface.hpp:28:43: warning: implicit conversion from 'std::__1::numeric_limits<unsigned long>::type' (aka 'unsigned long') to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Wimplicit-int-float-conversion]
         std::ceil(std::abs(::unif_rand()) * std::numeric_limits<size_t>::max());
                                           ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ../inst/include/dust/rng_interface.hpp:28:43: warning: implicit conversion from 'std::__1::numeric_limits<unsigned long>::type' (aka 'unsigned long') to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Wimplicit-int-float-conversion]
         std::ceil(std::abs(::unif_rand()) * std::numeric_limits<size_t>::max());
                                           ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ../inst/include/dust/interface.hpp:43:22: note: in instantiation of function template specialization 'dust::interface::as_rng_seed<double>' requested here
       dust::interface::as_rng_seed<typename T::real_t>(r_seed);
                        ^
   walk.cpp:113:19: note: in instantiation of function template specialization 'dust::r::dust_alloc<walk>' requested here
     return dust::r::dust_alloc<walk>(r_pars, pars_multi, step, r_n_particles,
                     ^
   2 warnings generated.

The output is fairly opaque, but I think we are ok, easiest way to run remotely is to do

docker run --rm -it -v $PWD:/input:ro kalibera/rchk:latest /input/dust_0.9.21.tar.gz
@richfitz
Copy link
Member Author

The warning comes from this bit of rng_interface.hpp

    size_t seed_int =
      std::ceil(std::abs(::unif_rand()) * std::numeric_limits<size_t>::max());

and should be easy to trigger with clang 10

@richfitz richfitz added this to the CRAN release (v1.0.x) milestone Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant