https://bugs.llvm.org/show_bug.cgi?id=37082

            Bug ID: 37082
           Summary: [Clang] Wrong code for re-definition of builtin
                    function
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: yangyib...@nju.edu.cn
                CC: llvm-bugs@lists.llvm.org

$ clang -v

$ cat small.c
#include <stdio.h> // #1
static int strcmp(){return 20;} // #2
#define strcmp __builtin_strcmp // #3
int main()
{
  int ret = strcmp("a","b");
  printf("%d\n", ret);
  return 0;
}

$ clang small.c; ./a.out
20

$ gcc small.c; ./a.out
-1


###
Since strcmp is re-defined in Line # 3, therefore, the correct output should be
-1.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to