<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 --- - Crash on parsing customized "vfprintf""
href="http://llvm.org/bugs/show_bug.cgi?id=16344">16344</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash on parsing customized "vfprintf"
</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>Linux
</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>wenhan.gu@gmail.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>$ cat test.c
void vfprintf() {} // Only one line in source
This only occurs for this function. If I write "void fprintf();", everything
works except for warning.
Clang 3.2 is good for this too.
$ clang -c test.c
test.c:1:6: warning: incompatible redeclaration of library function 'vfprintf'
[-Wincompatible-library-redeclaration]
void vfprintf() {}
^
test.c:1:6: note: 'vfprintf' is a builtin with type 'int ()'
0 clang 0x0000000002454ef2 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1 clang 0x0000000002456f42
2 libpthread.so.0 0x00007f723963e8f0
3 clang 0x0000000000b8b38e
clang::Sema::ActOnStartOfFunctionDef(clang::Scope*, clang::Decl*) + 2814
4 clang 0x0000000000a63342
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Pars
er::LateParsedAttrList*) + 4930
5 clang 0x0000000000a788a9
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRa
ngeInit*) + 2521
6 clang 0x0000000000a5e139
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang
::AccessSpecifier) + 249
7 clang 0x0000000000a5e83e
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*,
clang::AccessSpecifier) + 1022
8 clang 0x0000000000a5fb71
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 97
9 clang 0x0000000000a60612
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 194
10 clang 0x0000000000a56d60 clang::ParseAST(clang::Sema&, bool, bool)
+ 288
11 clang 0x00000000008acc05 clang::CodeGenAction::ExecuteAction() +
101
12 clang 0x000000000071d359 clang::FrontendAction::Execute() + 313
13 clang 0x00000000006f92e5
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 341
14 clang 0x00000000006dd997
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1543
15 clang 0x00000000006d3408 cc1_main(char const**, char const**, char
const*, void*) + 1272
16 clang 0x00000000006db493 main + 7651
17 libc.so.6 0x00007f723870dc4d __libc_start_main + 253
18 clang 0x00000000006d2d29
Stack dump:
0. Program arguments: /proj/mtk03872/usr/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
test.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.20.1 -coverage-file /proj/mtk03872/test.o -resource-dir
/proj/mtk03872/usr/bin/../lib/clang/3.4 -internal-isystem /usr/local/include
-internal-isystem /proj/mtk03872/usr/bin/../lib/clang/3.4/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir /proj/mtk03872 -ferror-limit 19 -fmessage-length 157
-mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties
-fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops
-o test.o -x c test.c
1. test.c:1:17: current parser token '{'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
375a040d49049c90b29b80cde480025f4ba5a717) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a>
7338de37a802970857079b5a532c5dd50d0a6d5d)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/test-WpMbm8.c
clang: note: diagnostic msg: /tmp/test-WpMbm8.sh
clang: note: diagnostic msg:
********************</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>