Skip to content

Conversation

laanwj
Copy link
Member

@laanwj laanwj commented Apr 15, 2012

This pull request enables most compilation warnings (of -Wall -Wextra) and fixes them. I compiled bitcoin-qt with g++ and clang to have as much warning coverage as possible. Warning flags in bitcoin-qt and bitcoind build have been equalized.

char-subscripts warnings were especially dangerous, as char can be negative, resulting in accesses outside the array and thus potential information leakage. Fixed this by adding (unsigned char).

I've left these warnings alone:

  • invalid-offsetof: Looked this up, and found http://stackoverflow.com/questions/1129894/why-cant-you-use-offsetof-on-non-pod-strucutures-in-c
    We use none of the special C++ multi-inheritance and dynamic casting so using offsetof should be safe.
  • sign-compare: There's just too darn many of 'em. These could be worth checking later, as wrong signed-unsigned comparisons can result in nasty bugs.
  • unused-parameter: Also way too many instances. And ignoring a parameter is no problem, usually.

I have carefully seperated this into commits for each separate warning class to make review easy.

@sipa
Copy link
Member

sipa commented Apr 15, 2012

ACK

@jgarzik
Copy link
Contributor

jgarzik commented Apr 15, 2012

ACK, good work cleaning all that up

jgarzik pushed a commit that referenced this pull request Apr 15, 2012
Enable and fix most compilation warnings
@jgarzik jgarzik merged commit 5a701eb into bitcoin:master Apr 15, 2012
coblee pushed a commit to litecoin-project/litecoin that referenced this pull request Jul 17, 2012
Enable and fix most compilation warnings
@laanwj laanwj deleted the 2012_04_clang branch April 9, 2014 14:14
suprnurd pushed a commit to chaincoin-legacy/chaincoin that referenced this pull request Dec 5, 2017
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request Jan 22, 2019
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request Nov 14, 2019
0672c46 [Trivial][GUI] Fix typos in welcome widget (random-zebra)

Pull request description:

  One-liner in welcomecontentwidget.ui. Closes PIVX-Project#1101 .
  (As a non-native speaker, I think "whomever" is correct as it refers to the object of the sentence, not the subject).

ACKs for top commit:
  Fuzzbawls:
    ACK 0672c46

Tree-SHA512: 24a6416344564eb27c53cc7d77bfa7245a44bd34ee7a6ccb051b6ee843c69b48cecd8245614ffd2ac73b3888603edfa96f17e7559d51c971db5b8b2ed4d076c5
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants