https://llvm.org/bugs/show_bug.cgi?id=31558
Bug ID: 31558
Summary: Incorrect -Wcast-align warning about function pointers
after r288267
Product: new-bugs
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
After r288267, -Wcast-align can now incorrectly warn about function pointers
that are about functions with different arguments.
Test case:
struct s;
void f(struct s *);
typedef void (*p)(void *);
p x = (p)&f; // warning: cast from 'void (*)(struct s *)' to 'p' (aka 'void
(*)(void *)') increases required alignment from 1 to 4 [-Wcast-align]
p y = (p)f; // no warning
So for some reason, using the address-of operator on a function name now makes
it incompatible. This used to give no warning before r288267.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs