atrosinenko wrote:
A side thought: what is the expected effect of this warning (namely, treating
implicit signing the same way as `__ptrauth` qualifiers) when building an
existing code base for a new target that has function pointer signing enabled?
My initial assumption is that in a ptrauth-unaware C code most function pointer
uses would be diagnosed. I'm not sure what the effect **should** be, but I
guess if my assumption is correct this could be quite unintended.
I mean something like this imaginary example:
```c
#include <stdlib.h>
typedef int (*cmp_t)(const void *, const void *);
void my_sort(void *base, size_t nmemb, cmp_t comparator);
void do_sort(void *base, size_t nmemb, size_t size, cmp_t comparator) {
cmp_t cmp = comparator; // <- warning
if (size == 8)
my_sort(base, nmemb, cmp);
else
qsort(base, nmemb, size, cmp);
}
```
https://github.com/llvm/llvm-project/pull/157779
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits