https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f9dc185ede4a0a3c9bda1…
commit f9dc185ede4a0a3c9bda1a4a77d034ceebda8d41
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sun Oct 13 17:02:51 2024 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Thu Jan 16 14:18:53 2025 +0200
[UCRT] Use a C cast instead of const_cast for GCC
This is because GCC will generate errors for both const_cast and static_cast depending on the template parameter:
- With const_cast: error: invalid 'const_cast' from type 'std::nullptr_t' to type 'const wchar_t**'
- With static_cast: error: invalid 'static_cast' from type 'wchar_t** const' to type 'const wchar_t**'
---
sdk/lib/ucrt/inc/corecrt_internal_strtox.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sdk/lib/ucrt/inc/corecrt_internal_strtox.h b/sdk/lib/ucrt/inc/corecrt_internal_strtox.h
index 102724dda7d..d3c4a0c0fb7 100644
--- a/sdk/lib/ucrt/inc/corecrt_internal_strtox.h
+++ b/sdk/lib/ucrt/inc/corecrt_internal_strtox.h
@@ -1870,7 +1870,7 @@ c_string_character_source<Character> __cdecl make_c_string_character_source(
EndPointer const end
) throw()
{
- return c_string_character_source<Character>(string, const_cast<Character const**>(end));
+ return c_string_character_source<Character>(string, (Character const**)(end));
}
template <typename Integer, typename Character, typename EndPointer>
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=47e3f49e5266ce9e4668b…
commit 47e3f49e5266ce9e4668bc96140161877ed0ba41
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Mon Oct 14 00:08:12 2024 +0300
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Thu Jan 16 14:18:53 2025 +0200
[UCRT] No __declspec(spectre(nomitigation)) for GCC/Clang
---
sdk/lib/ucrt/inc/corecrt_internal_stdio_output.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sdk/lib/ucrt/inc/corecrt_internal_stdio_output.h b/sdk/lib/ucrt/inc/corecrt_internal_stdio_output.h
index bb4d545d88c..6f9878a52cc 100644
--- a/sdk/lib/ucrt/inc/corecrt_internal_stdio_output.h
+++ b/sdk/lib/ucrt/inc/corecrt_internal_stdio_output.h
@@ -576,7 +576,10 @@ public:
// Instead of using an lfence mitigation, we can fill the table to a power of two,
// then bitwise-and all values used to index into the array.
- __declspec(spectre(nomitigation)) T const& operator[](size_t const index) const
+ #if defined(_MSC_VER) && !defined(__clang__)
+ __declspec(spectre(nomitigation))
+ #endif
+ T const& operator[](size_t const index) const
{
return m_array[index & mask];
}