<html>
<head>
<base href="https://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 --- - Confusing note and error message from Clang"
href="https://llvm.org/bugs/show_bug.cgi?id=26678">26678</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Confusing note and error message from Clang
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>1101.debian@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Upon attempt to compile this code:
#include <stdio.h>
#include <unistd.h>
void
foo(int i)
{
if (i < 0)
goto whoops;
if (i == 0)
printf("foo\n");
if (i > 0)
goto corrupt;
return;
whoops:
printf("whoops\n");
return
corrupt:
printf("corrupt\n");
}
Clang prints the following:
foo.c:21:1: error: use of undeclared identifier 'corrupt'; did you mean
'crypt'?
corrupt:
^~~~~~~
crypt
/usr/include/unistd.h:542:7: note: 'crypt' declared here
char *crypt(const char *, const char *);
^
foo.c:21:8: error: expected ';' after return statement
corrupt:
^
;
foo.c:14:11: error: use of undeclared label 'corrupt'
goto corrupt;
^
3 errors generated.
Which is not correct, since 'corrupt' is correct label, even though it's
defined after incorrect line ('return' statement doesn't terminate with ';')</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>