Skip to content

Fix -Werror build failure from GIT_DIFF_OPTIONS_INIT macro#123

Closed
map588 wants to merge 1 commit intoDeusData:mainfrom
map588:fix/build-githistory-werror
Closed

Fix -Werror build failure from GIT_DIFF_OPTIONS_INIT macro#123
map588 wants to merge 1 commit intoDeusData:mainfrom
map588:fix/build-githistory-werror

Conversation

@map588
Copy link
Copy Markdown
Contributor

@map588 map588 commented Mar 23, 2026

Replace compile-time GIT_DIFF_OPTIONS_INIT struct initializer with runtime git_diff_options_init() call. The macro triggers -Wmissing-field-initializers when libgit2 has more fields than the macro accounts for, which becomes a hard error under -Werror.

Replace compile-time GIT_DIFF_OPTIONS_INIT struct initializer with
runtime git_diff_options_init() call. The macro triggers
-Wmissing-field-initializers when libgit2 has more fields than the
macro accounts for, which becomes a hard error under -Werror.
@map588
Copy link
Copy Markdown
Contributor Author

map588 commented Mar 23, 2026

@DeusData The majority of the code came from the addition of the VHDL and Devicetree grammers. This one was the source of my errors trying to build from source, and the other mitigates two potential SQL injections and a JSON argument injection to the http server.

@DeusData
Copy link
Copy Markdown
Owner

DeusData commented Mar 23, 2026

Hey @map588, I know, but for me these are seperate concerns. I would like to review the bugs in a pr, so that they can be independently reviewed and merged without the new language. New languages are a bit more complex in that regard as I need to make sure that there are no vendor risks etc. It would be nice, if you could split this PR into several ones, so that I can look into them independently. That would be awesome 🙏

@map588
Copy link
Copy Markdown
Contributor Author

map588 commented Mar 23, 2026

@DeusData I already did this. I closed the first PR. I should have separated them to begin with, apologies.

@DeusData
Copy link
Copy Markdown
Owner

@map588 Thanks! Will get into this as soon as I can

@jsyrjala
Copy link
Copy Markdown

I guess the same fix is also here #91

@DeusData DeusData added the bug Something isn't working label Mar 23, 2026
@DeusData
Copy link
Copy Markdown
Owner

Thanks! This addresses the same issue as PR #91 and issue #104. We'll review both and merge the best approach.

@DeusData
Copy link
Copy Markdown
Owner

Thanks @map588 — your fix is identical to PR #91 by @jsyrjala (same file, same line, same replacement). Since #91 was filed first, we'll merge that one. Both of you independently arrived at the correct libgit2-recommended pattern — nice work.

@DeusData DeusData closed this Mar 23, 2026
@map588 map588 deleted the fix/build-githistory-werror branch March 24, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants