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

od:remove custom implementations of PartialEq and Eq #7211

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

alexs-sh
Copy link
Contributor

@alexs-sh alexs-sh commented Jan 26, 2025

About

Issue #7187

Description

Removing custom PartialEq and Eq implementations helps avoid issues like:

warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
  --> src/uu/od/src/formatteriteminfo.rs:29:45
   |
29 |             (IntWriter(a), IntWriter(b)) => a == b,
   |                                             ^^^^^^
   |
   = note: the address of the same function can vary between different codegen units
   = note: furthermore, different functions could have the same address after being merged together
 

Observable on nightly 1.86

Thank you

Removing custom PartialEq and Eq implementations helps avoid issues like:

    help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
       |
    29 |             (IntWriter(a), IntWriter(b)) => std::ptr::fn_addr_eq(*a, *b),
       |                                             ++++++++++++++++++++++ ~~~ +

Observable on nightly 1.86
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@sylvestre sylvestre merged commit 2430e2a into uutils:main Jan 26, 2025
64 of 65 checks passed
@sylvestre
Copy link
Contributor

Thanks

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.

od: warning: function pointer comparisons do not produce meaningful results
2 participants