summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cbits.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-23 08:35:44 +0100
committerTyge Løvset <[email protected]>2023-02-23 08:35:44 +0100
commit4ff4c8d352f76b658214029988eab7ce1d69efe8 (patch)
treeb4344007993fdb6460b7d4ecd3536a7f1e2b91b6 /include/stc/cbits.h
parent95f0b246cedc2d3669575ed2bfb398e6fbcb2b2f (diff)
downloadSTC-modified-4ff4c8d352f76b658214029988eab7ce1d69efe8.tar.gz
STC-modified-4ff4c8d352f76b658214029988eab7ce1d69efe8.zip
Internal updates.
Diffstat (limited to 'include/stc/cbits.h')
-rw-r--r--include/stc/cbits.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/stc/cbits.h b/include/stc/cbits.h
index e2d97f8c..fa0da665 100644
--- a/include/stc/cbits.h
+++ b/include/stc/cbits.h
@@ -61,8 +61,13 @@ int main() {
#define _cbits_words(n) (i_ssize)(((n) + 63)>>6)
#define _cbits_bytes(n) (_cbits_words(n) * c_sizeof(uint64_t))
-#if defined(__GNUC__) || defined(__clang__)
+#if defined(__GNUC__)
STC_INLINE int cpopcount64(uint64_t x) {return __builtin_popcountll(x);}
+ #ifndef __clang__
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wstringop-overflow="
+ #pragma GCC diagnostic ignored "-Walloc-size-larger-than="
+ #endif
#elif defined(_MSC_VER) && defined(_WIN64)
#include <intrin.h>
STC_INLINE int cpopcount64(uint64_t x) {return (int)__popcnt64(x);}
@@ -303,7 +308,9 @@ STC_INLINE bool _i_memb(_disjoint)(const i_type* self, const i_type* other) {
_i_assert(self->_size == other->_size);
return _cbits_disjoint(self->data64, other->data64, _i_memb(_size)(self));
}
-
+#if defined __GNUC__ && !defined __clang__
+#pragma GCC diagnostic pop
+#endif
#define CBITS_H_INCLUDED
#undef _i_size
#undef _i_memb