-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Replace random_shuffle by shuffle #3069
Replace random_shuffle by shuffle #3069
Conversation
8a55944
to
24ae68f
Compare
Beware of |
24ae68f
to
e852eff
Compare
…dernize-replace-random-shuffle' -fix
e852eff
to
27a5379
Compare
Just to mention: This Pr is ready to merge, so after merge we can maybe check, if PCL can now compiled with C++17. |
@Morwenn thanks for the tip. Do I understand you right that this affects only MinGW? I haven't seen any support questions about this platform for ages, so I assume that it's not popular among PCL users. With this in mind I think making PCL c++17 compatible is more important. |
@taketwo Yes, it only affects MinGW derivatives (including MinGW-w64). I use it for personal projects but I can't tell how much it is used with PCL since I'm only using PCL at work, so maybe you can safely ignore the correctness for the platform. It could be worth adding a note in the documentation though, just mentioning that operations relying on random number are only expected to work with MinGW[-w64] when used with the version corresponding to GCC10 (speculative though, I don't know whether the fix has been merged). An explicit note is probably better than a silent error that could go unnoticed for too long :) |
Hm, we already have a bunch of |
A note in the FAQ or eventually in a new Troubleshooting or Common issues or Platform-specific issues in the wiki would be the places where I would expect to find such information. |
@Morwenn: Is this bug only affecting |
In libstdc++ |
To be fair, I don't think we have critical cases which requires good quality random number generation. I.e. until proven otherwise, I would be perfectly ok in sticking with |
I don't think it's a huge problem per se, I'm just putting myself in the shoes of the person who might be bit by it someday: it's the kind of issue that can take days to understand since it's perfectly silent. @SergioRAgostinho The issue is that |
That part was clear from the start. What I wanted to bring to the table was discussing the consequences of replacing |
Oh, my bad then, sorry for the confusion. It's most likely fine if |
I'm merging this anyway because whatever we decide as follow-up will likely have its PR and place for discussion. |
Maybe add something like this:
|
Looks interesting. But we have |
It is the question, if they really need always a new seed. Mostly it is enough to have one |
Changes are done by
run-clang-tidy -header-filter='.*' -checks='-*,modernize-replace-random-shuffle' -fix