This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]