Skip to content

Conversation

@jeking3
Copy link
Contributor

@jeking3 jeking3 commented Nov 3, 2017

In building Boost.Uuid I was getting the following warnings with clang:

clang-linux.compile.c++.without-pth ../../bin.v2/libs/uuid/test/test_random_generator.test/clang-gnu-linux-5.0.0/debug/threadapi-pthread/test_random_generator.o
In file included from test/test_random_generator.cpp:16:
In file included from ../../boost/random.hpp:60:
../../boost/random/binomial_distribution.hpp:407:9: error: anonymous types declared in an anonymous union are an extension [-Werror,-Wnested-anon-types]
        struct {
        ^
In file included from test/test_random_generator.cpp:16:
In file included from ../../boost/random.hpp:63:
../../boost/random/discrete_distribution.hpp:95:60: error: unused parameter 'average' [-Werror,-Wunused-parameter]
    static WeightType normalize(WeightType val, WeightType average)
                                                           ^
../../boost/random/discrete_distribution.hpp:186:66: error: unused parameter 'weights' [-Werror,-Wunused-parameter]
    static WeightType try_get_sum(const std::vector<WeightType>& weights)
                                                                 ^
In file included from test/test_random_generator.cpp:16:
In file included from ../../boost/random.hpp:72:
In file included from ../../boost/random/negative_binomial_distribution.hpp:21:
../../boost/random/poisson_distribution.hpp:338:9: error: anonymous types declared in an anonymous union are an extension [-Werror,-Wnested-anon-types]
        struct {
        ^

This fixes #25

@swatanabe
Copy link
Collaborator

swatanabe commented Nov 3, 2017 via email

@jeking3
Copy link
Contributor Author

jeking3 commented Nov 3, 2017

Okay, I started doing that, but I was touching many lines of code and I was concerned that the review comment would be to disable the warning instead, but I can do the other. I can comment out the variable name instead of removing it. I'll look at the third issue again.

@swatanabe
Copy link
Collaborator

swatanabe commented Nov 3, 2017 via email

@jeking3
Copy link
Contributor Author

jeking3 commented Nov 9, 2017

Do you think the logic in try_get_sum is correct? It takes a vector of WeightType and returns 1 instead of summing them.

@swatanabe
Copy link
Collaborator

swatanabe commented Nov 9, 2017 via email

@jeking3 jeking3 changed the title Fix or hide warnings reported by clang Fix warnings reported by clang Nov 9, 2017
@jeking3
Copy link
Contributor Author

jeking3 commented Nov 9, 2017

This builds locally; I didn't run it through CI. Should really get the CI PR merged and then enable CI builds for all future pull requests...

@swatanabe
Copy link
Collaborator

swatanabe commented Nov 9, 2017 via email

@jeking3
Copy link
Contributor Author

jeking3 commented Nov 9, 2017

Yes, I see what you mean. If you want me to do it that way that's fine. I forgot to remove the suppressions because I did the work off the branch and then merged it in.

@jeking3
Copy link
Contributor Author

jeking3 commented Dec 5, 2017

I found a couple more extremely (100+ lines each) verbose warnings for unused variables that needed to be silenced while building this branch today.

@swatanabe swatanabe merged commit 9c82aad into boostorg:develop Jan 3, 2018
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

Successfully merging this pull request may close these issues.

2 participants