[PATCH] [ARC] define SIZE_TYPE and PTRDIFF_TYPE correctly

Andreas Schwab schwab@suse.de
Mon Oct 31 16:45:00 GMT 2016


On Okt 31 2016, Vineet Gupta <Vineet.Gupta1@synopsys.com> wrote:

> This silences tons of -Wformat= warnings when building ARC Linux kernel
> with gcc 6.x (and restores the ARC gcc 4.8.x behaviour) which had
> similar fix.
>
> gcc/
> 2016-10-28  Vineet Gupta <vgupta@synopsys.com>
>
>         * config/arc/arc.h (SIZE_TYPE): define as unsigned int.
> 	* (PTRDIFF_TYPE): define as int.
>
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> ---
>  gcc/config/arc/arc.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
> index cf13a7fa9fc3..0b579c44ee12 100644
> --- a/gcc/config/arc/arc.h
> +++ b/gcc/config/arc/arc.h
> @@ -282,10 +282,10 @@ if (GET_MODE_CLASS (MODE) == MODE_INT		\
>  #define DEFAULT_SIGNED_CHAR 0
>  
>  #undef SIZE_TYPE
> -#define SIZE_TYPE "long unsigned int"
> +#define SIZE_TYPE "unsigned int"
>  
>  #undef PTRDIFF_TYPE
> -#define PTRDIFF_TYPE "long int"
> +#define PTRDIFF_TYPE "int"
>  
>  #undef WCHAR_TYPE
>  #define WCHAR_TYPE "int"

This changes the C++ ABI.  You need to fix the kernel instead, see
arch/avr32/include/uapi/asm/posix_types.h for how to do that.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



More information about the Gcc-patches mailing list