[PATCH 28/42] rtems/score/tls.h: Add casts to eliminate warnings on some targets
Joel Sherrill
joel.sherrill at oarcorp.com
Mon Mar 23 14:39:26 UTC 2015
---
cpukit/score/include/rtems/score/tls.h | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/cpukit/score/include/rtems/score/tls.h b/cpukit/score/include/rtems/score/tls.h
index 139db78..51398a0 100644
--- a/cpukit/score/include/rtems/score/tls.h
+++ b/cpukit/score/include/rtems/score/tls.h
@@ -117,12 +117,18 @@ static inline uintptr_t _TLS_Get_allocation_size(
static inline void *_TLS_Copy_and_clear( void *tls_area )
{
- tls_area = memcpy( tls_area, _TLS_Data_begin, (size_t) _TLS_Data_size );
+ tls_area = memcpy(
+ tls_area,
+ _TLS_Data_begin,
+ (size_t) ((uintptr_t)_TLS_Data_size)
+ );
+
memset(
- (char *) tls_area + (size_t) _TLS_BSS_begin - (size_t) _TLS_Data_begin,
+ (char *) tls_area + (size_t)((intptr_t) _TLS_BSS_begin) -
+ (size_t)((intptr_t) _TLS_Data_begin),
0,
- (size_t) _TLS_BSS_size
+ ((size_t) (intptr_t)_TLS_BSS_size)
);
return tls_area;
--
1.9.3
More information about the devel
mailing list