Skip to content

crc32 module, clang spurious warning removal. #6725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions ext/standard/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ static inline int has_crc32_insn() {
# endif
}

# pragma GCC push_options
# pragma GCC target ("+nothing+crc")
# if defined(__GNUC__) && !defined(__clang__)
# pragma GCC push_options
# pragma GCC target ("+nothing+crc")
# endif
static uint32_t crc32_aarch64(uint32_t crc, char *p, size_t nr) {
while (nr >= sizeof(uint64_t)) {
crc = __crc32d(crc, *(uint64_t *)p);
Expand All @@ -73,7 +75,9 @@ static uint32_t crc32_aarch64(uint32_t crc, char *p, size_t nr) {
}
return crc;
}
# pragma GCC pop_options
# if defined(__GNUC__) && !defined(__clang__)
# pragma GCC pop_options
# endif
#endif

/* {{{ Calculate the crc32 polynomial of a string */
Expand Down