diff options
author | benl <benl@FreeBSD.org> | 2011-06-18 13:56:33 +0000 |
---|---|---|
committer | benl <benl@FreeBSD.org> | 2011-06-18 13:56:33 +0000 |
commit | 2071e3510abcb0d23655e9ec6f21ded8a0d7fa8a (patch) | |
tree | 6edd0c06e1319e9f8e2572723af2f2d72fabda97 /contrib/binutils/ld | |
parent | a90ed93de49d2b89aafba19680f2fd1d400eb91e (diff) | |
download | FreeBSD-src-2071e3510abcb0d23655e9ec6f21ded8a0d7fa8a.zip FreeBSD-src-2071e3510abcb0d23655e9ec6f21ded8a0d7fa8a.tar.gz |
Fix clang warnings.
Approved by: philip (mentor)
Diffstat (limited to 'contrib/binutils/ld')
-rw-r--r-- | contrib/binutils/ld/ldexp.c | 6 | ||||
-rw-r--r-- | contrib/binutils/ld/sysdep.h | 3 |
2 files changed, 6 insertions, 3 deletions
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 |