This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: small diffs to fix -enable-targets=all
- From: Jay <jayk123 at hotmail dot com>
- To: <binutils at sourceware dot org>
- Date: Sat, 26 Jul 2008 09:37:26 +0000
- Subject: RE: small diffs to fix -enable-targets=all
Another variation here is:
#define COFF_TI_ADJUST(base, offset) \
((char*) (base - (char*) offset))
though this really doesn't seem much better.
There's still an implicit ptrdiff_t in there.
Either I cast a pointer to a size_t, or I cast the result of pointer subtraction back to a pointer.
Yet another option maybe is to push the subtraction into a function instead of a macro.
Though that ought not help. If gcc can track the type info through casts, e.g.: this doesn't work:
#define COFF_TI_ADJUST(base, offset) \
(((char*) base) - offset)
then it should just as well be able to track it through function calls, if they are inlined.
I see there is #pragma GCC diagnostic, and C9x _Pragma but couldn't figure out how to get them to work quickly.
> From: jayk123@hotmail.com
> diff -ur gcc.orig/include/coff/ti.h gcc.mine/include/coff/ti.h
> --- gcc.orig/include/coff/ti.h 2005-05-10 03:21:09.000000000 -0700
> +++ gcc.mine/include/coff/ti.h 2008-07-25 18:59:40.078125000 -0700
> @@ -214,26 +214,45 @@
> +#define COFF_TI_ADJUST(base, offset) \
> + (((char*) (size_t) base) - offset)