https://sourceware.org/bugzilla/show_bug.cgi?id=24536
Bug ID: 24536 Summary: ld/ldbuildid.c: Incompatible pointer types in an assignment, -Werror/-Wcast-function-type Product: binutils Version: 2.33 (HEAD) Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: pexu at sourceware dot mail.kapsi.fi Target Milestone: --- Created attachment 11765 --> https://sourceware.org/bugzilla/attachment.cgi?id=11765&action=edit Suppress the warning by doing a `VOID (WINAPI *)(VOID)' cast. Hello. `ld/ldbuildid.c' hasn't changed for a while, but as of GCC8 it will not compile as there's an assignment using incompatible pointer types on line 139: uuid_create = (UuidCreateFn) GetProcAddress (rpc_library, "UuidCreate"); There's nothing wrong with the statement except that GCC8 has a new warning -Wcast-function-type that is (correctly) hit. By default -Werror is used if using GCC and not doing a release. Attached a proposed patch. It basically does an extra (stylized) `void (*)(void)' cast, as suggested by GCC documentation. `*((FARPROC *) &uuid_create) = ...', a style used by some Windows APIs, will break strict-aliasing rules, so it causes more problems that what it solves. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils