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

            Bug ID: 38059
           Summary: Inconsistent behavior symbol generation c vs c++.
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: mostr...@gmail.com
                CC: llvm-bugs@lists.llvm.org

Given this code (x.c):

int x;
const int y  = 2;
extern const int z;
const int z  = 3;

Compile:  clang-6.0 -c x.c -o xc.o
Compile as c++:   clang++-6.0 -c x.c -o x+.o

Look at generated symbols:

nm -a xc.o:
0000000000000004 C x
0000000000000000 a x.c
0000000000000000 R y
0000000000000004 R z

nm -a x+.o:
0000000000000000 B x
0000000000000000 a x.c
0000000000000000 R z

The C++ compilation does not generate a "y" symbol, but the C compilation does.

-- 
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