-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Compilation errors when building rust with GCC 6.1 #33246
Comments
NOTE: I edited you message to format the report. |
Should we fix the code, or just turn off the warning? It looks like miniz.c was imported wholesale from somewhere else... |
Worth mentioning that we don't have the latest version in-tree: https://github.com/rust-lang/rust/blob/master/src/rt/miniz.c |
@alexcrichton Just to know. Any reason to avoid a update for the |
Nah should be fine to update! |
@bors: retry On Fri, Apr 29, 2016 at 5:35 PM, Adelar da Silva Queiróz <
|
I updated the miniz.c locally, but it did not compile with gcc 6.1.1. |
No problem on ARM using gcc 6.1.0, go figure. And I didn't pass Edit: |
I was able to build the compiler and the docs with clang and I opened a issue on richgel999/miniz#51. |
Likewise with gcc, just add |
This fixes the build for me with GCC 6.1.1. diff --git a/src/rt/miniz.c b/src/rt/miniz.c
index 2b803b0..b3a453d 100644
--- a/src/rt/miniz.c
+++ b/src/rt/miniz.c
@@ -575,7 +575,10 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_nex
{
mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i;
r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32);
- for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
+ for ( i = 0; i <= 143; ++i) *p++ = 8;
+ for ( ; i <= 255; ++i) *p++ = 9;
+ for ( ; i <= 279; ++i) *p++ = 7;
+ for ( ; i <= 287; ++i) *p++ = 8;
}
else
{
@@ -1393,7 +1396,10 @@ static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahe
if ((d->m_dict[probe_pos + match_len] == c0) && (d->m_dict[probe_pos + match_len - 1] == c1)) break;
TDEFL_PROBE; TDEFL_PROBE; TDEFL_PROBE;
}
- if (!dist) break; p = s; q = d->m_dict + probe_pos; for (probe_len = 0; probe_len < max_match_len; probe_len++) if (*p++ != *q++) break;
+ if (!dist) break;
+ p = s;
+ q = d->m_dict + probe_pos;
+ for (probe_len = 0; probe_len < max_match_len; probe_len++) if (*p++ != *q++) break;
if (probe_len > match_len)
{
*pMatch_dist = dist; if ((*pMatch_len = match_len = probe_len) == max_match_len) return; |
There is a PR addressing this: #33798 |
And I made a PR to upstream: richgel999/miniz#52 Regards |
Fixed by #33798. |
There's still another compilation failure with gcc 6 here
|
We have since removed |
Here is what I get when I clone rust from github and try to build it with GCC 6.1:
The text was updated successfully, but these errors were encountered: