summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorbenl <benl@FreeBSD.org>2011-06-18 13:56:33 +0000
committerbenl <benl@FreeBSD.org>2011-06-18 13:56:33 +0000
commit2071e3510abcb0d23655e9ec6f21ded8a0d7fa8a (patch)
tree6edd0c06e1319e9f8e2572723af2f2d72fabda97 /contrib
parenta90ed93de49d2b89aafba19680f2fd1d400eb91e (diff)
downloadFreeBSD-src-2071e3510abcb0d23655e9ec6f21ded8a0d7fa8a.zip
FreeBSD-src-2071e3510abcb0d23655e9ec6f21ded8a0d7fa8a.tar.gz
Fix clang warnings.
Approved by: philip (mentor)
Diffstat (limited to 'contrib')
-rw-r--r--contrib/binutils/bfd/coffcode.h2
-rw-r--r--contrib/binutils/bfd/opncls.c2
-rw-r--r--contrib/binutils/bfd/peicode.h2
-rw-r--r--contrib/binutils/gas/config/obj-elf.c2
-rw-r--r--contrib/binutils/gas/frags.c2
-rw-r--r--contrib/binutils/gas/subsegs.c4
-rw-r--r--contrib/binutils/ld/ldexp.c6
-rw-r--r--contrib/binutils/ld/sysdep.h3
-rw-r--r--contrib/binutils/opcodes/i386-dis.c24
-rw-r--r--contrib/gcc/cfg.c2
-rw-r--r--contrib/gcc/output.h3
-rw-r--r--contrib/gcc/rtl.h11
-rw-r--r--contrib/gcc/tree.h13
-rw-r--r--contrib/gperf/src/gen-perf.cc2
-rw-r--r--contrib/gperf/src/key-list.cc2
15 files changed, 47 insertions, 33 deletions
diff --git a/contrib/binutils/bfd/coffcode.h b/contrib/binutils/bfd/coffcode.h
index a2aac5f..e654148 100644
--- a/contrib/binutils/bfd/coffcode.h
+++ b/contrib/binutils/bfd/coffcode.h
@@ -3240,7 +3240,7 @@ coff_compute_section_file_positions (bfd * abfd)
incremented in coff_set_section_contents. This is right for
SVR3.2. */
if (strcmp (current->name, _LIB) == 0)
- bfd_set_section_vma (abfd, current, 0);
+ (void) bfd_set_section_vma (abfd, current, 0);
#endif
previous = current;
diff --git a/contrib/binutils/bfd/opncls.c b/contrib/binutils/bfd/opncls.c
index 9e0cc26..ad22db5 100644
--- a/contrib/binutils/bfd/opncls.c
+++ b/contrib/binutils/bfd/opncls.c
@@ -231,7 +231,7 @@ bfd_fopen (const char *filename, const char *target, const char *mode, int fd)
then it may have been opened with special flags that make it
unsafe to close and reopen the file. */
if (fd == -1)
- bfd_set_cacheable (nbfd, TRUE);
+ (void) bfd_set_cacheable (nbfd, TRUE);
return nbfd;
}
diff --git a/contrib/binutils/bfd/peicode.h b/contrib/binutils/bfd/peicode.h
index 0f4858f..4ae10db 100644
--- a/contrib/binutils/bfd/peicode.h
+++ b/contrib/binutils/bfd/peicode.h
@@ -607,7 +607,7 @@ pe_ILF_make_a_section (pe_ILF_vars * vars,
bfd_set_section_flags (vars->abfd, sec, flags | extra_flags);
- bfd_set_section_alignment (vars->abfd, sec, 2);
+ (void) bfd_set_section_alignment (vars->abfd, sec, 2);
/* Check that we will not run out of space. */
BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size);
diff --git a/contrib/binutils/gas/config/obj-elf.c b/contrib/binutils/gas/config/obj-elf.c
index 2f93990..12ca242 100644
--- a/contrib/binutils/gas/config/obj-elf.c
+++ b/contrib/binutils/gas/config/obj-elf.c
@@ -1636,7 +1636,7 @@ obj_elf_init_stab_section (segT seg)
/* Force the section to align to a longword boundary. Without this,
UnixWare ar crashes. */
- bfd_set_section_alignment (stdoutput, seg, 2);
+ (void) bfd_set_section_alignment (stdoutput, seg, 2);
/* Make space for this first symbol. */
p = frag_more (12);
diff --git a/contrib/binutils/gas/frags.c b/contrib/binutils/gas/frags.c
index adb9b19..98ac536 100644
--- a/contrib/binutils/gas/frags.c
+++ b/contrib/binutils/gas/frags.c
@@ -146,7 +146,7 @@ frag_new (int old_frags_var_max_size
/* This will align the obstack so the next struct we allocate on it
will begin at a correct boundary. */
- obstack_finish (&frchain_now->frch_obstack);
+ (void) obstack_finish (&frchain_now->frch_obstack);
frchP = frchain_now;
know (frchP);
former_last_fragP = frchP->frch_last;
diff --git a/contrib/binutils/gas/subsegs.c b/contrib/binutils/gas/subsegs.c
index 0094764..066a2fd 100644
--- a/contrib/binutils/gas/subsegs.c
+++ b/contrib/binutils/gas/subsegs.c
@@ -67,7 +67,7 @@ subseg_change (register segT seg, register int subseg)
{
seginfo = xcalloc (1, sizeof (*seginfo));
seginfo->bfd_section = seg;
- bfd_set_section_userdata (stdoutput, seg, seginfo);
+ (void) bfd_set_section_userdata (stdoutput, seg, seginfo);
}
}
@@ -169,7 +169,7 @@ subseg_get (const char *segname, int force_new)
secptr->output_section = secptr;
seginfo = xcalloc (1, sizeof (*seginfo));
seginfo->bfd_section = secptr;
- bfd_set_section_userdata (stdoutput, secptr, seginfo);
+ (void) bfd_set_section_userdata (stdoutput, secptr, seginfo);
}
return secptr;
}
diff --git a/contrib/binutils/ld/ldexp.c b/contrib/binutils/ld/ldexp.c
index 4f1d61d..809b958 100644
--- a/contrib/binutils/ld/ldexp.c
+++ b/contrib/binutils/ld/ldexp.c
@@ -1112,9 +1112,9 @@ exp_get_fill (etree_type *tree, fill_type *def, char *name)
fill = xmalloc (4 + sizeof (*fill) - 1);
val = expld.result.value;
fill->data[0] = (val >> 24) & 0xff;
- fill->data[1] = (val >> 16) & 0xff;
- fill->data[2] = (val >> 8) & 0xff;
- fill->data[3] = (val >> 0) & 0xff;
+ __PAST_END(fill->data, 1) = (val >> 16) & 0xff;
+ __PAST_END(fill->data, 2) = (val >> 8) & 0xff;
+ __PAST_END(fill->data, 3) = (val >> 0) & 0xff;
fill->size = 4;
}
return fill;
diff --git a/contrib/binutils/ld/sysdep.h b/contrib/binutils/ld/sysdep.h
index 4c5e994..2ee2047 100644
--- a/contrib/binutils/ld/sysdep.h
+++ b/contrib/binutils/ld/sysdep.h
@@ -54,6 +54,9 @@ extern char *strrchr ();
/* for MAXPATHLEN */
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#ifndef __PAST_END
+# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
+#endif
#endif
#ifdef PATH_MAX
# define LD_PATHMAX PATH_MAX
diff --git a/contrib/binutils/opcodes/i386-dis.c b/contrib/binutils/opcodes/i386-dis.c
index e84d314..10de45b 100644
--- a/contrib/binutils/opcodes/i386-dis.c
+++ b/contrib/binutils/opcodes/i386-dis.c
@@ -3203,7 +3203,7 @@ ckprefix (void)
rex_used = 0;
while (1)
{
- FETCH_DATA (the_info, codep + 1);
+ (void) FETCH_DATA (the_info, codep + 1);
newrex = 0;
switch (*codep)
{
@@ -3606,7 +3606,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
insn_codep = codep;
sizeflag = priv.orig_sizeflag;
- FETCH_DATA (info, codep + 1);
+ (void) FETCH_DATA (info, codep + 1);
two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
if (((prefixes & PREFIX_FWAIT)
@@ -3628,7 +3628,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
if (*codep == 0x0f)
{
unsigned char threebyte;
- FETCH_DATA (info, codep + 2);
+ (void) FETCH_DATA (info, codep + 2);
threebyte = *++codep;
dp = &dis386_twobyte[threebyte];
need_modrm = twobyte_has_modrm[*codep];
@@ -3639,7 +3639,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
codep++;
if (dp->name == NULL && dp->op[0].bytemode == IS_3BYTE_OPCODE)
{
- FETCH_DATA (info, codep + 2);
+ (void) FETCH_DATA (info, codep + 2);
op = *codep++;
switch (threebyte)
{
@@ -3724,7 +3724,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
}
else if (need_modrm)
{
- FETCH_DATA (info, codep + 1);
+ (void) FETCH_DATA (info, codep + 1);
modrm.mod = (*codep >> 6) & 3;
modrm.reg = (*codep >> 3) & 7;
modrm.rm = *codep & 7;
@@ -4890,7 +4890,7 @@ OP_E (int bytemode, int sizeflag)
if (base == 4)
{
havesib = 1;
- FETCH_DATA (the_info, codep + 1);
+ (void) FETCH_DATA (the_info, codep + 1);
index = (*codep >> 3) & 7;
if (address_mode == mode_64bit || index != 0x4)
/* When INDEX == 0x4 in 32 bit mode, SCALE is ignored. */
@@ -5147,7 +5147,7 @@ get64 (void)
unsigned int a;
unsigned int b;
- FETCH_DATA (the_info, codep + 8);
+ (void) FETCH_DATA (the_info, codep + 8);
a = *codep++ & 0xff;
a |= (*codep++ & 0xff) << 8;
a |= (*codep++ & 0xff) << 16;
@@ -5169,7 +5169,7 @@ get32 (void)
{
bfd_signed_vma x = 0;
- FETCH_DATA (the_info, codep + 4);
+ (void) FETCH_DATA (the_info, codep + 4);
x = *codep++ & (bfd_signed_vma) 0xff;
x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
@@ -5182,7 +5182,7 @@ get32s (void)
{
bfd_signed_vma x = 0;
- FETCH_DATA (the_info, codep + 4);
+ (void) FETCH_DATA (the_info, codep + 4);
x = *codep++ & (bfd_signed_vma) 0xff;
x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
@@ -5198,7 +5198,7 @@ get16 (void)
{
int x = 0;
- FETCH_DATA (the_info, codep + 2);
+ (void) FETCH_DATA (the_info, codep + 2);
x = *codep++ & 0xff;
x |= (*codep++ & 0xff) << 8;
return x;
@@ -6018,7 +6018,7 @@ OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
const char *mnemonic;
- FETCH_DATA (the_info, codep + 1);
+ (void) FETCH_DATA (the_info, codep + 1);
/* AMD 3DNow! instructions are specified by an opcode suffix in the
place where an 8-bit immediate would normally go. ie. the last
byte of the instruction. */
@@ -6054,7 +6054,7 @@ OP_SIMD_Suffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
unsigned int cmp_type;
- FETCH_DATA (the_info, codep + 1);
+ (void) FETCH_DATA (the_info, codep + 1);
obufp = obuf + strlen (obuf);
cmp_type = *codep++ & 0xff;
if (cmp_type < 8)
diff --git a/contrib/gcc/cfg.c b/contrib/gcc/cfg.c
index aa8eaca..ec11f43 100644
--- a/contrib/gcc/cfg.c
+++ b/contrib/gcc/cfg.c
@@ -830,7 +830,7 @@ dump_cfg_bb_info (FILE *file, basic_block bb)
else
fprintf (file, ", ");
first = false;
- fprintf (file, bb_bitnames[i]);
+ fputs (bb_bitnames[i], file);
}
if (!first)
fprintf (file, ")");
diff --git a/contrib/gcc/output.h b/contrib/gcc/output.h
index 1d9b837..9b29059 100644
--- a/contrib/gcc/output.h
+++ b/contrib/gcc/output.h
@@ -109,13 +109,14 @@ extern void output_addr_const (FILE *, rtx);
/* Output a string of assembler code, substituting numbers, strings
and fixed syntactic prefixes. */
-#if GCC_VERSION >= 3004
+#if GCC_VERSION >= 3004 && !defined(__clang__)
#define ATTRIBUTE_ASM_FPRINTF(m, n) __attribute__ ((__format__ (__asm_fprintf__, m, n))) ATTRIBUTE_NONNULL(m)
/* This is a magic identifier which allows GCC to figure out the type
of HOST_WIDE_INT for %wd specifier checks. You must issue this
typedef before using the __asm_fprintf__ format attribute. */
typedef HOST_WIDE_INT __gcc_host_wide_int__;
#else
+/* FIXME(benl): what about %wd? */
#define ATTRIBUTE_ASM_FPRINTF(m, n) ATTRIBUTE_NONNULL(m)
#endif
diff --git a/contrib/gcc/rtl.h b/contrib/gcc/rtl.h
index 6c76f9d..d4af682 100644
--- a/contrib/gcc/rtl.h
+++ b/contrib/gcc/rtl.h
@@ -22,6 +22,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#ifndef GCC_RTL_H
#define GCC_RTL_H
+#include <sys/param.h>
+#ifndef __PAST_END
+# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
+#endif
+
#include "statistics.h"
#include "machmode.h"
#include "input.h"
@@ -565,12 +570,12 @@ extern void rtvec_check_failed_bounds (rtvec, int, const char *, int,
#define RTL_CHECK1(RTX, N, C1) ((RTX)->u.fld[N])
#define RTL_CHECK2(RTX, N, C1, C2) ((RTX)->u.fld[N])
-#define RTL_CHECKC1(RTX, N, C) ((RTX)->u.fld[N])
+#define RTL_CHECKC1(RTX, N, C) __PAST_END((RTX)->u.fld, N)
#define RTL_CHECKC2(RTX, N, C1, C2) ((RTX)->u.fld[N])
-#define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[I])
+#define RTVEC_ELT(RTVEC, I) __PAST_END((RTVEC)->elem, I)
#define XWINT(RTX, N) ((RTX)->u.hwint[N])
#define XCWINT(RTX, N, C) ((RTX)->u.hwint[N])
-#define XCMWINT(RTX, N, C, M) ((RTX)->u.hwint[N])
+#define XCMWINT(RTX, N, C, M) __PAST_END((RTX)->u.hwint, N)
#define XCNMWINT(RTX, N, C, M) ((RTX)->u.hwint[N])
#define XCNMPRV(RTX, C, M) (&(RTX)->u.rv)
#define BLOCK_SYMBOL_CHECK(RTX) (&(RTX)->u.block_sym)
diff --git a/contrib/gcc/tree.h b/contrib/gcc/tree.h
index 7861514..97090be 100644
--- a/contrib/gcc/tree.h
+++ b/contrib/gcc/tree.h
@@ -22,6 +22,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#ifndef GCC_TREE_H
#define GCC_TREE_H
+#include <sys/param.h>
+#ifndef __PAST_END
+# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
+#endif
+
#include "hashtab.h"
#include "machmode.h"
#include "input.h"
@@ -830,12 +835,12 @@ extern void omp_clause_range_check_failed (const tree, const char *, int,
#define TREE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define EXPR_CHECK(T) (T)
#define NON_TYPE_CHECK(T) (T)
-#define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I])
-#define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I])
-#define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
+#define TREE_VEC_ELT_CHECK(T, I) __PAST_END((T)->vec.a, I)
+#define TREE_OPERAND_CHECK(T, I) __PAST_END((T)->exp.operands, I)
+#define TREE_OPERAND_CHECK_CODE(T, CODE, I) __PAST_END((T)->exp.operands, I)
#define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I]))
#define PHI_NODE_ELT_CHECK(T, i) ((T)->phi.a[i])
-#define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i])
+#define OMP_CLAUSE_ELT_CHECK(T, i) __PAST_END((T)->omp_clause.ops, i)
#define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T)
diff --git a/contrib/gperf/src/gen-perf.cc b/contrib/gperf/src/gen-perf.cc
index 8840dc6..7cf9f06 100644
--- a/contrib/gperf/src/gen-perf.cc
+++ b/contrib/gperf/src/gen-perf.cc
@@ -246,7 +246,7 @@ Gen_Perf::change (List_Node *prior, List_Node *curr)
{
if (option[DEBUG])
{
- fprintf (stderr, " by changing asso_value['%c'] (char #%zd) to %d\n",
+ fprintf (stderr, " by changing asso_value['%c'] (char #%td) to %d\n",
*p, p - union_set + 1, asso_values[(unsigned char)(*p)]);
fflush (stderr);
}
diff --git a/contrib/gperf/src/key-list.cc b/contrib/gperf/src/key-list.cc
index 2461470..11292bc 100644
--- a/contrib/gperf/src/key-list.cc
+++ b/contrib/gperf/src/key-list.cc
@@ -1441,7 +1441,7 @@ Key_List::output_lookup_array (void)
if (option[DEBUG])
fprintf (stderr,
- "dup_ptr[%zd]: hash_value = %d, index = %d, count = %d\n",
+ "dup_ptr[%td]: hash_value = %d, index = %d, count = %d\n",
dup_ptr - duplicates,
dup_ptr->hash_value, dup_ptr->index, dup_ptr->count);
OpenPOWER on IntegriCloud