<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 --- - -Wbackslash-newline-escape printed twice, but only when other warning is present"
href="https://llvm.org/bugs/show_bug.cgi?id=27622">27622</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-Wbackslash-newline-escape printed twice, but only when other warning is present
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>doug.coleman@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>The -Wbackslash-newline-escape is printed twice, but only when other warnings
are present. Case 1) demonstrates the bug, cases 2) and 3) are each
warning/error by themselves, where the warning is not erroneously printed
twice.
1) This program demonstrates the bug. Notice that the ``hello.c:1:19`` warning
is displayed twice. (There's a space character after the \, not the text
[space])
Program```
#include <stdio.h\[space]
"
```
Output```
ergmac:~ erg$ clang hello.c
hello.c:1:19: warning: backslash and newline separated by space
[-Wbackslash-newline-escape]
#include <stdio.h\
^
hello.c:1:19: warning: backslash and newline separated by space
[-Wbackslash-newline-escape]
hello.c:1:18: warning: missing terminating '"' character [-Winvalid-pp-token]
#include <stdio.h\
^
hello.c:2:2: error: expected "FILENAME" or <FILENAME>
"
^
3 warnings and 1 error generated.
```
2) The same program with the correct terminator character only displays the
warning once. (No space after the \)
Program```
ergmac:~ erg$ cat hello.c
#include <stdio.h\
>
```
Output```
ergmac:~ erg$ clang hello.c
hello.c:1:19: warning: backslash and newline separated by space
[-Wbackslash-newline-escape]
#include <stdio.h\
^
1 warning generated.
```
3) The same program without the space but with the wrong terminator.
Program```
ergmac:~ erg$ cat hello.c
#include <stdio.h\
"
```
Output```
ergmac:~ erg$ clang hello.c
hello.c:1:18: warning: missing terminating '"' character [-Winvalid-pp-token]
#include <stdio.h\
^
hello.c:2:2: error: expected "FILENAME" or <FILENAME>
"
^
1 warning and 1 error generated.
```</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>