<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 --- - Inline procedure defined in the same module isn't found by the linker"
href="http://llvm.org/bugs/show_bug.cgi?id=20983">20983</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Inline procedure defined in the same module isn't found by the linker
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>FreeBSD
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>release blocker
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>yuri@tsoft.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>Function setRGB is first declared as inline, then defined as inline, and then
not found by the linker.
$ clang -I/usr/local/include -lm -L/usr/local/lib -lpng -o makePNG makePNG.c
/tmp/makePNG-3638e2.o: In function `writeImage':
makePNG.c:(.text+0x6e8): undefined reference to `setRGB'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Removing 'inline' attribute fixes the compile.
This problem is particularly bad due to the simplicity of this situation.
The testcase is from this book:
<a href="http://www.labbookpages.co.uk/software/imgProc/libPNG.html">http://www.labbookpages.co.uk/software/imgProc/libPNG.html</a>
Particular failing program:
<a href="http://www.labbookpages.co.uk/software/imgProc/files/libPNG/makePNG.c">http://www.labbookpages.co.uk/software/imgProc/files/libPNG/makePNG.c</a>
(The only change I made is replaced malloc.h -> stdlib.h)
gcc compiles it successfully.
Observed in rev.217271 on FreeBSD 10</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>