-
Notifications
You must be signed in to change notification settings - Fork 388
fix several printf-related warnings #2309
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
06299c7
upgrade Expects/Ensures to use std::format
mazunki 992f150
fix mismatched type specifiers
mazunki 8d744de
fix printf type-specifiers
mazunki d5d80d4
make narrowing cast explicit
mazunki 02cbf15
fix printf-type specifiers
mazunki c371d43
update format specifier type
mazunki 8cdf954
explicitly redefine INFO()
mazunki b193d38
use proper format specifier for pointer
mazunki 43ed3d6
void unused variable
mazunki 40d5526
add libfmt as a dependency
mazunki 3a8099c
include and link to libfmt
mazunki 26dbce3
define kprintf-size as a kernel:: atribute
mazunki 59263d4
replace usage of cstr with fmt::
mazunki cce83fe
update type specifiers to match type
mazunki ed25751
allow editors to find libfmt declarations
mazunki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # note that there is also `<nixpkgs>.fmt` | ||
| # so this entire file could just be `{ pkgs }: pkgs.fmt` | ||
| { | ||
| pkgs, | ||
| stdenv ? pkgs.stdenv, | ||
| cmake ? pkgs.cmake | ||
| }: | ||
| let | ||
| libfmt = stdenv.mkDerivation rec { | ||
| pname = "fmt"; | ||
| version = "12.0.0"; | ||
|
|
||
| src = pkgs.fetchFromGitHub { | ||
| owner = "fmtlib"; | ||
| repo = "fmt"; | ||
| rev = "12.0.0"; | ||
| hash = "sha256-AZDmIeU1HbadC+K0TIAGogvVnxt0oE9U6ocpawIgl6g="; | ||
| }; | ||
|
|
||
| nativeBuildInputs = [ cmake ]; | ||
|
|
||
| cmakeFlags = [ | ||
| "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" | ||
| "-DBUILD_SHARED_LIBS=OFF" | ||
|
|
||
| "-DFMT_TEST=OFF" | ||
| "-DFMT_DOC=OFF" | ||
| "-DFMT_INSTALL=ON" | ||
| ]; | ||
| }; | ||
| in | ||
| libfmt // { | ||
| include = "${libfmt}/include"; | ||
| lib = "${libfmt}/lib"; | ||
| } | ||
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure there's no way of doing the same without adding another dependency? If we're sure std::fmt absolutely requires futex and fmtlib/fmt doesn't, I'm fine with this. But would much prefer to use the standard if we can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extent of what I changed can work just the same without
libfmt. That said, libfmt does have some additional quality of life features such as colours and<fmt/compile.h>. Bothstd::format()andfmt::format()behave the same when it comes to futexes, and bothstd::format_to()andfmt::format_to()work without it.If you want I can revert the addition of libfmt. Should be rather trivial.