From 9063f9ed9c719042e36f99032739c926df03e248 Mon Sep 17 00:00:00 2001 From: Andre Vieira Date: Tue, 5 Jun 2018 15:07:09 +0000 Subject: [PATCH] [arm] Make arm_cmse.h C99 compatible gcc/ChangeLog 2018-06-05 Andre Vieira * config/arm/arm_cmse.h (cmse_nsfptr_create): Change typeof to __typeof__. (cmse_check_pointed_object): Likewise. gcc/testsuite/ChangeLog 2018-06-05 Andre Vieira * gcc.target/arm/cmse/cmse-1c99.c: New test. From-SVN: r261204 --- gcc/ChangeLog | 6 ++++++ gcc/config/arm/arm_cmse.h | 4 ++-- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/arm/cmse/cmse-1c99.c | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/arm/cmse/cmse-1c99.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 25ab6bded67..6643c2e7d1c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-06-05 Andre Vieira + + * config/arm/arm_cmse.h (cmse_nsfptr_create): Change typeof to + __typeof__. + (cmse_check_pointed_object): Likewise. + 2018-06-05 Martin Liska PR gcov-profile/47618 diff --git a/gcc/config/arm/arm_cmse.h b/gcc/config/arm/arm_cmse.h index f972e23659d..9b35537cd33 100644 --- a/gcc/config/arm/arm_cmse.h +++ b/gcc/config/arm/arm_cmse.h @@ -173,7 +173,7 @@ cmse_nonsecure_caller (void) #define CMSE_MPU_NONSECURE 16 #define CMSE_NONSECURE 18 -#define cmse_nsfptr_create(p) ((typeof ((p))) ((__INTPTR_TYPE__) (p) & ~1)) +#define cmse_nsfptr_create(p) ((__typeof__ ((p))) ((__INTPTR_TYPE__) (p) & ~1)) #define cmse_is_nsfptr(p) (!((__INTPTR_TYPE__) (p) & 1)) @@ -187,7 +187,7 @@ __extension__ void * cmse_check_address_range (void *, size_t, int); #define cmse_check_pointed_object(p, f) \ - ((typeof ((p))) cmse_check_address_range ((p), sizeof (*(p)), (f))) + ((__typeof__ ((p))) cmse_check_address_range ((p), sizeof (*(p)), (f))) #endif /* __ARM_FEATURE_CMSE & 1 */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 83aef994748..2bdc952f075 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-06-05 Andre Vieira + + * gcc.target/arm/cmse/cmse-1c99.c: New test. + 2018-06-05 Cesar Philippidis PR fortran/85701 diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse-1c99.c b/gcc/testsuite/gcc.target/arm/cmse/cmse-1c99.c new file mode 100644 index 00000000000..0f99dd341b7 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/cmse/cmse-1c99.c @@ -0,0 +1,4 @@ +/* { dg-do compile } */ +/* { dg-options "-Os -mcmse -std=c99" } */ +/* This is a copy of cmse-1.c to test arm_mve.h ISO C compatibility. */ +#include "cmse-1.c" -- 2.30.2