- I introduced the wrong format macro with my former patch (#2018), this needs to be signed not unsigned (thanks Luke-Jr)
ConnectBlock(): fix error() format to be unsigned #2022
pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:fix_#2018 changing 1 files +1 −1-
Diapolo commented at 8:48 PM on November 16, 2012: none
-
Diapolo commented at 9:03 PM on November 16, 2012: none
These were the warning my patch fixes: src\main.cpp: In member function 'bool CBlock::ConnectBlock(CBlockIndex*, CCoinsViewCache&, bool)': src\main.cpp:warning: unknown conversion type character 'l' in format [-Wformat] src\main.cpp:warning: unknown conversion type character 'l' in format [-Wformat] src\main.cpp:warning: too many arguments for format [-Wformat-extra-args]
-
luke-jr commented at 9:36 PM on November 16, 2012: member
Looks like a bug in Microsoft printf family of functions :(
ACK for 0.7.2 & master
-
Diapolo commented at 9:40 PM on November 16, 2012: none
Thanks for taking a look and I wanted to clarify why I patched it :).
-
sipa commented at 10:27 PM on November 16, 2012: member
ACK
-
jgarzik commented at 12:51 AM on November 17, 2012: contributor
Please fix the commit message. The one-line summary of your change, as it appears in "git shortlog" and other tools, is wholly useless: "fix pull #2018"
That is utterly meaningless without further research; it tells nothing about what code is modified, or how it was modified, or why it needed modification.
We use "git shortlog" to generate summaries for release notes and other purposes. The first line is a summary of the change, and for this, probably should be something like "ConnectBlock: fix error() format to be unsigned" etc.
-
luke-jr commented at 1:45 AM on November 17, 2012: member
@laanwj %lld is standard C printf format, but not supported by Microsoft's printf: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=1963136&group_id=2435
-
laanwj commented at 1:47 AM on November 17, 2012: member
Ooh, okay something made by MS is incompatible to the standards, now that's a now one, let's call the press :)
-
laanwj commented at 8:22 AM on November 17, 2012: member
I still don't get those warnings though. We define:
#ifndef PRI64d #if defined(_MSC_VER) || defined(__MSVCRT__) #define PRI64d "I64d" #define PRI64u "I64u" #define PRI64x "I64x" #else #define PRI64d "lld" #define PRI64u "llu" #define PRI64x "llx" #endif #endifWhich means that in the case of MS, we use "special" retarded character sequences. The thing is, there is no 'l' in any of those. So where does that warning come from?
-
laanwj commented at 8:45 AM on November 17, 2012: member
Right, I get it now, thanks
-
11406c89fe
ConnectBlock(): fix error() format to be unsigned
- I introduced the wrong format macro with my former patch (#2018), this needs to be signed not unsigned (thanks Luke-Jr)
- laanwj referenced this in commit 4725e96a3a on Nov 17, 2012
- laanwj merged this on Nov 17, 2012
- laanwj closed this on Nov 17, 2012
- laudney referenced this in commit 4c5a8e64bc on Mar 19, 2014
- KolbyML referenced this in commit 8385a96f94 on Dec 5, 2020
- DrahtBot locked this on Sep 8, 2021