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

Warnings about uninitialized variables in bessel_ik #1197

Open
Lastique opened this issue Sep 12, 2024 · 1 comment
Open

Warnings about uninitialized variables in bessel_ik #1197

Lastique opened this issue Sep 12, 2024 · 1 comment

Comments

@Lastique
Copy link
Member

Lastique commented Sep 12, 2024

Building Boost.Math 1.86.0 on Ubuntu 24.04, gcc 13.2 produces these warnings:

In file included from ./boost/math/special_functions/bessel.hpp:24,
                 from ./boost/math/special_functions/airy.hpp:12,
                 from ./boost/math/special_functions.hpp:15,
                 from libs/math/build/../src/tr1/pch.hpp:9:
./boost/math/special_functions/detail/bessel_ik.hpp: In function ‘boost_cyl_bessel_k’:
./boost/math/special_functions/detail/bessel_ik.hpp:417:11: warning: ‘u’ may be used uninitialized [-Wmaybe-uninitialized]
  417 |         T z = (u + n % 2);
      |           ^
./boost/math/special_functions/detail/bessel_ik.hpp:304:7: note: ‘u’ was declared here
  304 |     T u, Iv, Kv, Kv1, Ku, Ku1, fv;
      |       ^
./boost/math/special_functions/detail/bessel_ik.hpp:417:22: warning: ‘n’ may be used uninitialized [-Wmaybe-uninitialized]
  417 |         T z = (u + n % 2);
      |                    ~~^~~
./boost/math/special_functions/detail/bessel_ik.hpp:307:14: note: ‘n’ was declared here
  307 |     unsigned n, k;
      |              ^

From a brief look these look legitimate, but I didn't investigate deeply.

@mborland
Copy link
Member

Should be fixed by: #1111. Further discussion is in: #1181

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

2 participants