<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 --- - clang compiles code without error, but gcc fails with error."
href="http://llvm.org/bugs/show_bug.cgi?id=17319">17319</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang compiles code without error, but gcc fails with error.
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.2
</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>James.Dutton@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>Created <span class=""><a href="attachment.cgi?id=11259" name="attach_11259" title="The bfl.c file showing the errors.">attachment 11259</a> <a href="attachment.cgi?id=11259&action=edit" title="The bfl.c file showing the errors.">[details]</a></span>
The bfl.c file showing the errors.
Seems to be a problem with va_start, va_arg, va_end macros.
Compiling with clang reports no errors
/bin/bash ../../../../libtool --tag=CC --mode=compile clang -DHAVE_CONFIG_H
-I. -I../../../../src -I../../../../include -O0 -g3 -Wall -fPIC -g -O2 -MT
bfl.lo -MD -MP -MF .deps/bfl.Tpo -c -o bfl.lo bfl.c
libtool: compile: clang -DHAVE_CONFIG_H -I. -I../../../../src
-I../../../../include -O0 -g3 -Wall -fPIC -g -O2 -MT bfl.lo -MD -MP -MF
.deps/bfl.Tpo -c bfl.c -fPIC -DPIC -o .libs/bfl.o
bfl.c:310:1: warning: unused function 'dump_reloc_set' [-Wunused-function]
dump_reloc_set (bfd *abfd, asection *sec, arelent **relpp, long relcount)
^
1 warning generated.
Compiling with gcc reports errors and fails to compile.
/bin/bash ../../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.
-I../../../../src -I../../../../include -O0 -g3 -Wall -fPIC -g -O2 -MT bfl.lo
-MD -MP -MF .deps/bfl.Tpo -c -o bfl.lo bfl.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../../../src
-I../../../../include -O0 -g3 -Wall -fPIC -g -O2 -MT bfl.lo -MD -MP -MF
.deps/bfl.Tpo -c bfl.c -fPIC -DPIC -o .libs/bfl.o
bfl.c: In function 'bf_get_reloc_table_code_section':
bfl.c:391:11: warning: variable 'sym_val' set but not used
[-Wunused-but-set-variable]
bfl.c:389:6: warning: variable 'tmp' set but not used
[-Wunused-but-set-variable]
bfl.c: In function 'bf_get_reloc_table_data_section':
bfl.c:455:11: warning: variable 'sym_val' set but not used
[-Wunused-but-set-variable]
bfl.c:453:6: warning: variable 'tmp' set but not used
[-Wunused-but-set-variable]
bfl.c: In function 'bf_get_reloc_table_rodata_section':
bfl.c:519:11: warning: variable 'sym_val' set but not used
[-Wunused-but-set-variable]
bfl.c:517:6: warning: variable 'tmp' set but not used
[-Wunused-but-set-variable]
bfl.c: In function 'bf_disassemble_print_callback':
bfl.c:935:2: warning: implicit declaration of function 'va_start'
[-Wimplicit-function-declaration]
bfl.c:937:3: warning: implicit declaration of function 'va_arg'
[-Wimplicit-function-declaration]
bfl.c:937:21: error: expected expression before 'char'
bfl.c:940:21: error: expected expression before 'char'
bfl.c:946:2: warning: implicit declaration of function 'va_end'
[-Wimplicit-function-declaration]
bfl.c: At top level:
bfl.c:310:1: warning: 'dump_reloc_set' defined but not used [-Wunused-function]
make: *** [bfl.lo] Error 1</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>