Tiny fixes: printf error messages and gitignore#338
Open
sourcejedi wants to merge 2 commits intojborg:masterfrom
Open
Tiny fixes: printf error messages and gitignore#338sourcejedi wants to merge 2 commits intojborg:masterfrom
sourcejedi wants to merge 2 commits intojborg:masterfrom
Conversation
Fixes warnings on 32-bit (x86).
1. Cast sizeof() to match printf specifier
2. Cast off_t to long long. This is guaranteed 64-bit.
No performance concern because it's an error message.
attic/_hashindex.c: In function ‘hashindex_read’:
attic/_hashindex.c:148:13: warning: format ‘%ld’ expects argument of type ‘long
int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
EPRINTF_MSG_PATH(path, "failed to read %ld bytes", sizeof(HashHeader));
^
attic/_hashindex.c:188:13: warning: format ‘%ld’ expects argument of type ‘long
int’, but argument 4 has type ‘off_t’ [-Wformat=]
EPRINTF_MSG_PATH(path, "failed to read %ld bytes", length);
^
Contributor
|
isn't %ju format and casting all these values to (uintmax_t) a more general solution? |
Author
|
This' a bit less noisy and should work on Windows :). I saw elsewhere Windows isn't supported. So |
Contributor
|
@sourcejedi is there a problem with %j and Windows? Or Cygwin? |
Author
|
It's a problem with native Windows. http://stackoverflow.com/a/22537979/799204 Apparently Cygwin is a whole 'nother library, so if you're using that then I don't know. I'd like to think it supports a 15-year old standard which has no fully-portable alternative :). |
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.
Two tiny fixes, please merge :).
hashindex: Fix printf size specifiers in error messages
gitignore: all cython generated files