From: Reid Kleckner Date: Tue, 14 Feb 2017 18:38:19 +0000 (+0000) Subject: Fix some warnings in intrin.h X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b25147e04e21314488f0d1596c48d39c3ba14bdb;p=clang Fix some warnings in intrin.h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295082 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/intrin.h b/lib/Headers/intrin.h index 1b98dd8267..930d46552f 100644 --- a/lib/Headers/intrin.h +++ b/lib/Headers/intrin.h @@ -897,19 +897,21 @@ __readfsqword(unsigned long __offset) { #ifdef __x86_64__ static __inline__ unsigned char __DEFAULT_FN_ATTRS __readgsbyte(unsigned long __offset) { - return *__ptr_to_addr_space(256, unsigned char, __offset); + return *__ptr_to_addr_space(256, unsigned char, (unsigned long long)__offset); } static __inline__ unsigned short __DEFAULT_FN_ATTRS __readgsword(unsigned long __offset) { - return *__ptr_to_addr_space(256, unsigned short, __offset); + return *__ptr_to_addr_space(256, unsigned short, + (unsigned long long)__offset); } static __inline__ unsigned long __DEFAULT_FN_ATTRS __readgsdword(unsigned long __offset) { - return *__ptr_to_addr_space(256, unsigned long, __offset); + return *__ptr_to_addr_space(256, unsigned long, (unsigned long long)__offset); } static __inline__ unsigned __int64 __DEFAULT_FN_ATTRS __readgsqword(unsigned long __offset) { - return *__ptr_to_addr_space(256, unsigned __int64, __offset); + return *__ptr_to_addr_space(256, unsigned __int64, + (unsigned long long)__offset); } #endif #undef __ptr_to_addr_space