<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - __attirbute__ ((common)) has no expected effect when compiling for iOS or iOS Simulator"
href="http://llvm.org/bugs/show_bug.cgi?id=16330">16330</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>__attirbute__ ((common)) has no expected effect when compiling for iOS or iOS Simulator
</td>
</tr>
<tr>
<th>Product</th>
<td>dragonegg
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>baldrick@free.fr
</td>
</tr>
<tr>
<th>Reporter</th>
<td>petr.lefner@aponia.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Hello,
had someone ever used Clang's extensions inside ObjC++ file, namely the
__attribute__ ((common)) ?
For me, there's a problem with that, LLVM Linker reports 'duplicit symbol'
error if I declare a variable with same name in .mm file and one or more .m or
.cpp files:
/* foo_A.m */
__attribute__ ((common)) int foo;
/* foo_B.m */
__attribute__ ((common)) int foo;
/* foo_C.mm */
__attribute__ ((common)) int foo;
Gives linker error.
However, everything is fine, once I obey the use of 'foo' in the 'foo_C.mm', or
just rename the variable - linker feels happy.
Is this behavior expected?
Reported clang version:
clang++ --version
Apple LLVM version 5.0 (clang-500.1.58) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix
LLVM version:
llvm-g++-4.2 --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658)
(LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>