[llvm-bugs] [Bug 40472] New: error in backend: Prototypeless function used with conflicting signatures

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 25 15:24:43 PST 2019


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: unassignedbugs at nondot.org
          Reporter: alonzakai at gmail.com
                CC: llvm-bugs at lists.llvm.org

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 (git at github.com:llvm-mirror/clang.git
0a4307de1174f61c465c94111f8376d3f5ed548e) (git at github.com: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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190125/44e00679/attachment-0001.html>


More information about the llvm-bugs mailing list