[rtems commit] score: Use __typeof__ for strict ISO C compat

Sebastian Huber sebh at rtems.org
Thu Dec 6 12:42:15 UTC 2018


Module:    rtems
Branch:    master
Commit:    e50b4bd341b905da2c727b16b7d821a3deb392bc
Changeset: http://git.rtems.org/rtems/commit/?id=e50b4bd341b905da2c727b16b7d821a3deb392bc

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Dec  6 13:40:08 2018 +0100

score: Use __typeof__ for strict ISO C compat

Enable the use of RTEMS_DEVOLATILE() and RTEMS_DECONST() in strict ISO C
environments.

---

 cpukit/include/rtems/score/basedefs.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpukit/include/rtems/score/basedefs.h b/cpukit/include/rtems/score/basedefs.h
index 97f4fce..e484681 100644
--- a/cpukit/include/rtems/score/basedefs.h
+++ b/cpukit/include/rtems/score/basedefs.h
@@ -397,7 +397,7 @@
 
 /* The reference type idea based on libHX by Jan Engelhardt */
 #define RTEMS_TYPEOF_REFX(_ptr_level, _ptr_type) \
-  typeof(_ptr_level(union { int z; typeof(_ptr_type) x; }){0}.x)
+  __typeof__(_ptr_level(union { int z; __typeof__(_ptr_type) x; }){0}.x)
 
 #if defined(__GNUC__) && !defined(ASM)
 #if  ((__GNUC__ * 1000 + __GNUC_MINOR__) >= 4004)
@@ -480,8 +480,8 @@ extern void RTEMS_DEQUALIFY_types_not_compatible(void);
 #ifdef __GNUC__
   #define RTEMS_HAVE_MEMBER_SAME_TYPE( _t_lhs, _m_lhs, _t_rhs, _m_rhs ) \
     __builtin_types_compatible_p( \
-      __typeof( ( (_t_lhs *) 0 )->_m_lhs ), \
-      __typeof( ( (_t_rhs *) 0 )->_m_rhs ) \
+      __typeof__( ( (_t_lhs *) 0 )->_m_lhs ), \
+      __typeof__( ( (_t_rhs *) 0 )->_m_rhs ) \
     )
 #else
   #define RTEMS_HAVE_MEMBER_SAME_TYPE( _t_lhs, _m_lhs, _t_rhs, _m_rhs ) \




More information about the vc mailing list