markfasheh / duperemove

Tools for deduping file systems
GNU General Public License v2.0
832 stars 82 forks source link

Dupremove fails to compile on 32-bit system with GCC-14: incompatible pointer types #344

Closed NHOrus closed 6 months ago

NHOrus commented 6 months ago

Gentoo bug: https://bugs.gentoo.org/928358 Error:

run_dedupe.c:161:44: error: passing argument 4 of ‘fiemap_count_shared’ from incompatible pointer type [-Wincompatible-pointer-types[https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types]]
  161 |                                            &bytes);
      |                                            ^~~~~~
      |                                            |
      |                                            uint64_t * {aka long long unsigned int *}
In file included from run_dedupe.c:42:
fiemap.h:29:75: note: expected ‘size_t *’ {aka ‘unsigned int *’} but argument is of type ‘uint64_t *’ {aka ‘long long unsigned int *’}
   29 | count_shared(int fd, size_t start_off, size_t end_off, size_t *shared);
      |                                                        ~~~~~~~~^~~~~~

As size_t is 32 bit on 32-bit systems and 64 on 64-bit.

JackSlateur commented 6 months ago

Hello @NHOrus Thank you for the report, I believe this is now fixed

Best regards

NHOrus commented 6 months ago

Thank you! And now, wait until someone replicates that...