[arm] Make arm_cmse.h C99 compatible
authorAndre Vieira <andre.simoesdiasvieira@arm.com>
Tue, 5 Jun 2018 15:07:09 +0000 (15:07 +0000)
committerAndre Vieira <avieira@gcc.gnu.org>
Tue, 5 Jun 2018 15:07:09 +0000 (15:07 +0000)
gcc/ChangeLog
2018-06-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>

* 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  <andre.simoesdiasvieira@arm.com>

* gcc.target/arm/cmse/cmse-1c99.c: New test.

From-SVN: r261204

gcc/ChangeLog
gcc/config/arm/arm_cmse.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/cmse/cmse-1c99.c [new file with mode: 0644]

index 25ab6bded67904adf38b101132976ed953459672..6643c2e7d1caaf77cd555f54580e610565c6134c 100644 (file)
@@ -1,3 +1,9 @@
+2018-06-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>
+
+       * config/arm/arm_cmse.h (cmse_nsfptr_create): Change typeof to
+       __typeof__.
+       (cmse_check_pointed_object): Likewise.
+
 2018-06-05  Martin Liska  <mliska@suse.cz>
 
        PR gcov-profile/47618
index f972e23659d557728570d7af93d96b0310e4ff47..9b35537cd33bca8053d2d34378581aae7dbc1e8f 100644 (file)
@@ -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 */
 
index 83aef9947485d69a5df825ee6396a6cfc4027d79..2bdc952f075b46282e796e60142b8744e86e5fd9 100644 (file)
@@ -1,3 +1,7 @@
+2018-06-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>
+
+       * gcc.target/arm/cmse/cmse-1c99.c: New test.
+
 2018-06-05  Cesar Philippidis  <cesar@codesourcery.com>
 
        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 (file)
index 0000000..0f99dd3
--- /dev/null
@@ -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"