- Use -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameters
- Remove xCXXFLAGS usage in makefile.unix
- Fix several recent and older sign-compare warnings
Clean up warnings #1230
pull sipa wants to merge 1 commits into bitcoin:master from sipa:warnings changing 13 files +24 −26-
sipa commented at 1:50 AM on May 9, 2012: member
-
f621326c24
Clean up warnings
* Use -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameters * Remove xCXXFLAGS usage in makefile.unix * Fix several recent and older sign-compare warnings
-
jgarzik commented at 2:10 AM on May 9, 2012: contributor
nUBucket and GetNewBucket() should be unsigned, not casted.
The rest looks ACK-able.
-
sipa commented at 2:14 AM on May 9, 2012: member
In some places, the bucket identifier -1 outside the normal valid range is used to denote an illegal value , so they are ints. Another possibility would be making them unsigned, and use the value (unsigned int)-1 to denote illegal values.
The first option required less code change, and it doesn't really matter; there are only 64 and 256 buckets.
-
jgarzik commented at 2:33 AM on May 9, 2012: contributor
ACK
-
gmaxwell commented at 11:06 AM on May 9, 2012: contributor
Considering that we don't even work on big endian, the implementation definedness of (unsigned int)-1 shouldn't bother me that much. But it does. In all other contexts casting a negative value to an unsigned type, which may not be so obviously unsigned if its a typedef, is almost certainly a bug. I'd much rather we were doing something else... but not reason to delay this pull.
- gmaxwell referenced this in commit 2e767410b8 on May 9, 2012
- gmaxwell merged this on May 9, 2012
- gmaxwell closed this on May 9, 2012
-
in bitcoin-qt.pro:None in f621326c24
89 | @@ -90,7 +90,7 @@ contains(BITCOIN_NEED_QT_PLUGINS, 1) { 90 | DEFINES += HAVE_BUILD_INFO 91 | } 92 | 93 | -QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-invalid-offsetof -Wno-sign-compare -Wno-unused-parameter 94 | +QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter
rebroad commented at 5:21 PM on May 17, 2012:Is this making the compiler or strict, or less...?
gmaxwell commented at 5:49 PM on May 17, 2012:More. "-Wno-" deactivates a warning (e.g. for ones which are otherwise turned on by -Wextra or -Wall)
coblee referenced this in commit d89fa50273 on Jul 17, 2012sipa deleted the branch on Jun 23, 2017dexX7 referenced this in commit 076613f1cb on Jul 1, 2021DrahtBot locked this on Sep 8, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 09:16 UTC
More mirrored repositories can be found on mirror.b10c.me