Skip to content

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
@github-actions
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

@alexs-sh alexs-sh deleted the od-use-derived-cmp branch May 11, 2025 19:29
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