darwin.system_cmds: fix build with clang 16#235487
Merged
toonn merged 1 commit intoNixOS:stagingfrom Jun 11, 2023
Merged
Conversation
toonn
reviewed
Jun 10, 2023
pkgs/os-specific/darwin/apple-source-releases/system_cmds/fix-implicit-declarations.patch
Outdated
Show resolved
Hide resolved
1c24fe0 to
a00b4d6
Compare
Clang 16 makes implicit declarations an error by default. The headers are available, so include them. `getline` was renamed to `get_line` to avoid a name clash. `util.h` includes `stdio.h`, which defines `getline`.
a00b4d6 to
cd4ab1d
Compare
toonn
reviewed
Jun 11, 2023
Contributor
toonn
left a comment
There was a problem hiding this comment.
Hmm, testing this by passing -Werror=strict-prototypes I get a ton more locations that need to be patched. This wasn't the case with Clang 16? I wonder why.
toonn
approved these changes
Jun 11, 2023
Contributor
toonn
left a comment
There was a problem hiding this comment.
I was enabling the wrong warning as error, should've been implicit-function-declaration >.<
LGTM now!
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.
Description of changes
Clang 16 makes implicit declarations an error by default. The headers
are available, so include them.
getlinewas renamed toget_lineto avoid a name clash.util.hincludes
stdio.h, which definesgetline.Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)