Make Git for Windows compile with GCC 8.x#2149
Merged
dscho merged 3 commits intogit-for-windows:masterfrom Apr 5, 2019
Merged
Conversation
The return type of the `GetProcAddress()` function is `FARPROC` which evaluates to `long long int (*)()`, i.e. it cannot be cast to the correct function signature by GCC 8. To work around that, we first cast to `void *` and go on with our merry lives. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The kwset functionality makes use of the obstack code, which expects to be handed a function that can allocate large chunks of data. It expects that function to accept a `size` parameter of type `long`. This upsets GCC 8 on Windows, because `long` does not have the same bit size as `size_t` there. Now, the proper thing to do would be to switch to `size_t`. But this would make us deviate from the "upstream" code even further, making it hard to synchronize with newer versions, and also it would be quite involved because that `long` type is so invasive in that code. Let's punt, and instead provide a super small wrapper around `xmalloc()`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is needed to make things compile with GCC 8.x and later. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Member
Author
|
@szeder could you have a quick look over these changes? |
|
It seems upstream obstack code has been using size_t since 266ac1b98
(obstack: 64-bit obstack support, part 1, 2014-10-29) [1], so
switching to size_t in our copy would actually bring it closer to
upstream :)
Considering the alternatives, namely:
- switching from long to size_t in our copy, or
- re-importing from upstream and applying our necessary
modifications on top [2], thereby risking messing up the conflict
resolutions and/or requiring further modifications to kwset,
I think that your small wrapper function is a simple and reasonable
solution.
[1] http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=266ac1b98dbf76a78cdc584b10ed73355a084e7a
[2] I tried to 'cp -v ../tmp/gnulib/lib/obstack.{c,h} compat/ &&
make', and got about two screenful errors...
I think only 3254310 (obstack.c: Fix some sparse warnings,
2011-09-11) and d190a08 (obstack: Fix portability issues,
2011-08-28) are necessary, as in the meantime upstream had fixed
what our other changes did.
|
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
git-for-windows-ci
pushed a commit
that referenced
this pull request
Apr 5, 2019
Make Git for Windows compile with GCC 8.x
git-for-windows-ci
pushed a commit
that referenced
this pull request
Apr 5, 2019
Make Git for Windows compile with GCC 8.x
git-for-windows-ci
pushed a commit
that referenced
this pull request
Apr 5, 2019
Make Git for Windows compile with GCC 8.x
git-for-windows-ci
pushed a commit
that referenced
this pull request
Apr 11, 2019
Make Git for Windows compile with GCC 8.x
git-for-windows-ci
pushed a commit
that referenced
this pull request
Apr 11, 2019
Make Git for Windows compile with GCC 8.x
git-for-windows-ci
pushed a commit
that referenced
this pull request
Apr 11, 2019
Make Git for Windows compile with GCC 8.x
git-for-windows-ci
pushed a commit
that referenced
this pull request
Apr 19, 2019
Make Git for Windows compile with GCC 8.x
git-for-windows-ci
pushed a commit
that referenced
this pull request
Apr 22, 2019
Make Git for Windows compile with GCC 8.x
git-for-windows-ci
pushed a commit
that referenced
this pull request
Apr 23, 2019
Make Git for Windows compile with GCC 8.x
dscho
added a commit
that referenced
this pull request
Apr 27, 2019
Make Git for Windows compile with GCC 8.x
dscho
added a commit
that referenced
this pull request
Apr 27, 2019
Make Git for Windows compile with GCC 8.x
dscho
added a commit
that referenced
this pull request
Apr 27, 2019
Make Git for Windows compile with GCC 8.x
dscho
added a commit
that referenced
this pull request
Apr 27, 2019
Make Git for Windows compile with GCC 8.x
dscho
added a commit
that referenced
this pull request
May 7, 2019
Make Git for Windows compile with GCC 8.x
dscho
added a commit
that referenced
this pull request
May 7, 2019
Make Git for Windows compile with GCC 8.x
git-for-windows-ci
pushed a commit
that referenced
this pull request
May 8, 2019
Make Git for Windows compile with GCC 8.x
dscho
added a commit
that referenced
this pull request
May 8, 2019
Make Git for Windows compile with GCC 8.x
dscho
added a commit
that referenced
this pull request
May 9, 2019
Make Git for Windows compile with GCC 8.x
dscho
added a commit
that referenced
this pull request
May 9, 2019
Make Git for Windows compile with GCC 8.x
dscho
added a commit
that referenced
this pull request
May 9, 2019
Make Git for Windows compile with GCC 8.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just a couple of things on top of what upstream already fixed for GCC 8.x.