Skip to content

pkt-line: fix incorrect function declaration #192

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

Conversation

dscho
Copy link
Member

@dscho dscho commented May 13, 2019

MS Visual C detected a mismatch between the declaration and the definition of set_packet_header(): it is declared with its second parameter missing the const attribute.

It also detected a mismatch between the declaration and the definition of parse_opt_unknown_cb().

These problems must have been introduced very recently; I do not recall seeing them before today in any of Git for Windows' ever-green branches (i.e. master semi-automatically rebased continously onto pu, next, master and maint).

You could not have seen it in git.git's own Azure Pipeline, as Git for Windows' version already has support to build with MSVC (I plan to submit this directly after v2.22.0 is out).

dscho added 2 commits May 13, 2019 23:43
When this function was changed in a97d007 (remote-curl: use
post_rpc() for protocol v2 also, 2019-02-21) from file-local to global,
the declaration was incorrectly missing the `const` qualifier.

Let's fix that.

Signed-off-by: Johannes Schindelin <[email protected]>
In f41179f (parse-options: avoid magic return codes, 2019-01-27),
the signature of the low-level parse-opt callback function was changed
to return an `enum`.

And while the implementations were changed, one declaration was left
unchanged, still claiming to return `int`.

This can potentially lead to problems, as compilers are free to choose
any integral type for an `enum` as long as it can represent all declared
values.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho
Copy link
Member Author

dscho commented May 13, 2019

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented May 13, 2019

Submitted as [email protected]

@gitgitgadget
Copy link

gitgitgadget bot commented May 15, 2019

This branch is now known as js/parseopt-unknown-cb-returns-an-enum.

@gitgitgadget
Copy link

gitgitgadget bot commented May 15, 2019

This patch series was integrated into pu via git@d097692.

@gitgitgadget gitgitgadget bot added the pu label May 15, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented May 16, 2019

This patch series was integrated into pu via git@ea68d60.

@gitgitgadget
Copy link

gitgitgadget bot commented May 16, 2019

This patch series was integrated into next via git@0feef07.

@gitgitgadget gitgitgadget bot added the next label May 16, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented May 19, 2019

This patch series was integrated into pu via git@7a09f5f.

@gitgitgadget
Copy link

gitgitgadget bot commented May 19, 2019

This patch series was integrated into next via git@7a09f5f.

@gitgitgadget
Copy link

gitgitgadget bot commented May 19, 2019

This patch series was integrated into master via git@7a09f5f.

@gitgitgadget gitgitgadget bot added the master label May 19, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented May 19, 2019

Closed via 7a09f5f.

@gitgitgadget gitgitgadget bot closed this May 19, 2019
@dscho dscho deleted the fix-set_packet_header-signature branch May 20, 2019 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant