[PATCH] D131351: [C] Default implicit function pointer conversions diagnostic to be an error

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 10 13:43:21 PDT 2022


aaron.ballman added a comment.

In D131351#3714062 <https://reviews.llvm.org/D131351#3714062>, @nikic wrote:

> This seems to break the test-suite build:
>
>   FAILED: CTMark/ClamAV/CMakeFiles/clamscan.dir/libclamav_readdb.c.o 
>   /root/llvm-compile-time-tracker/llvm-test-suite-build/tools/timeit --summary CTMark/ClamAV/CMakeFiles/clamscan.dir/libclamav_readdb.c.o.time /root/llvm-compile-time-tracker/llvm-project-build/bin/clang -DNDEBUG  -fexperimental-new-pass-manager -O0 -g   -w -Werror=date-time -DHAVE_CONFIG_H -I/root/llvm-compile-time-tracker/llvm-test-suite/CTMark/ClamAV -I/root/llvm-compile-time-tracker/llvm-test-suite/CTMark/ClamAV/zlib -DDONT_LOCK_DBDIRS -DC_LINUX -DFPU_WORDS_BIGENDIAN=0 -DWORDS_BIGENDIAN=0 -MD -MT CTMark/ClamAV/CMakeFiles/clamscan.dir/libclamav_readdb.c.o -MF CTMark/ClamAV/CMakeFiles/clamscan.dir/libclamav_readdb.c.o.d -o CTMark/ClamAV/CMakeFiles/clamscan.dir/libclamav_readdb.c.o   -c /root/llvm-compile-time-tracker/llvm-test-suite/CTMark/ClamAV/libclamav_readdb.c
>   /root/llvm-compile-time-tracker/llvm-test-suite/CTMark/ClamAV/libclamav_readdb.c:1145:49: error: incompatible function pointer types passing 'int (const struct dirent *, const struct dirent *)' to parameter of type '__compar_fn_t' (aka 'int (*)(const void *, const void *)') [-Wincompatible-function-pointer-types]
>       qsort(dents, ndents, sizeof(struct dirent), dirent_compare);
>                                                   ^~~~~~~~~~~~~~
>   /usr/include/stdlib.h:831:20: note: passing argument to parameter '__compar' here
>                      __compar_fn_t __compar) __nonnull ((1, 4));
>                                    ^
>   1 error generated.

Thanks, I'll try to take care of this shortly!

> Is it intentional that this generates an error for benign differences (in pointer types only)?

Yes, it's still UB.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131351/new/

https://reviews.llvm.org/D131351



More information about the cfe-commits mailing list