Skip to content

Commit

Permalink
Merge pull request cppfastio#737 from trcrsired/master
Browse files Browse the repository at this point in the history
Add pragma gcc to disable warnings in hacks
  • Loading branch information
trcrsired authored Jun 12, 2024
2 parents c4148f6 + bf9fe29 commit 65f0b9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions include/fast_io_unit/string_impl/libstdc++.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC system_header
#endif

namespace fast_io::details::string_hack
{

Expand Down
6 changes: 5 additions & 1 deletion include/fast_io_unit/string_impl/msvc_stl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC system_header
#endif

namespace fast_io::details::string_hack
{

Expand Down Expand Up @@ -40,7 +44,7 @@ inline constexpr decltype(auto) hack_scary_val(::std::basic_string<elem, traits,
#endif
= typename model_t::_Scary_val *;
return *reinterpret_cast<scary_ptr>(reinterpret_cast<::std::byte *>(__builtin_addressof(str)) +
offsetof(model_t, _Mypair) + offsetof(compress_pair_type, _Myval2));
__builtin_addressof(model_t, _Mypair) + __builtin_addressof(compress_pair_type, _Myval2));
}

template <typename T>
Expand Down

0 comments on commit 65f0b9f

Please sign in to comment.