https://bugs.llvm.org/show_bug.cgi?id=40472
Bug ID: 40472
Summary: error in backend: Prototypeless function used with
conflicting signatures
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: WebAssembly
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
STR: a.c is
===
#include <stdio.h>
int main()
{
printf("hello %d\n", strnlen("waka", 2)); // Implicit declaration, no
header, for strnlen
int (*my_strnlen)(char*, ...) = strnlen;
printf("hello %d\n", my_strnlen("shaka", 2));
return 0;
}
===
Build with
./emcc a.c -Wno-implicit-function-declaration
Output is
===
a.c:5:11: warning: incompatible pointer types initializing 'int (*)(char *,
...)' with an expression of type 'int ()' [-Wincompatible-pointer-types]
int (*my_strnlen)(char*, ...) = strnlen;
^ ~~~~~~~
fatal error: error in backend: Prototypeless function used with conflicting
signatures: strnlen
clang-8: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 9.0.0 ([email protected]:llvm-mirror/clang.git
0a4307de1174f61c465c94111f8376d3f5ed548e) ([email protected]:llvm-mirror/llvm.git
74ebd8a99755a5e0e1c14001de05fc089f0ee28f)
Target: wasm32-unknown-unknown-wasm
===
(The warning is correct.)
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs