{
 "number": 36275,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36275",
 "title": "build: enable `-Wunused-const-variable`",
 "author": "fanquake",
 "author_association": "MEMBER",
 "created_at": "2026-09-16T15:14:48Z",
 "updated_at": "2026-09-16T15:45:10Z",
 "age_days": 1,
 "draft": true,
 "labels": [
  "Build system",
  "CI failed"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "4d57fba4781e21bbba00ddb2e562e250b597395a",
 "head_ref": "unused_const_variable",
 "head_repo": "fanquake/bitcoin",
 "head_history": [
  {
   "t": "2026-09-16T15:43:37Z",
   "sha": "4d57fba4781e21bbba00ddb2e562e250b597395a"
  }
 ],
 "additions": 31,
 "deletions": 27,
 "changed_files": 10,
 "commit_count": 5,
 "size_bucket": "S",
 "mergeable_state": "unstable",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {},
   "conflicts": []
  }
 },
 "acks_parsed": {},
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": []
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": true,
  "mergeable_state": "unstable",
  "last_author_activity": "2026-09-16T15:43:37Z",
  "last_reviewer_activity": null,
  "last_reviewer": null,
  "author_silent_days": 1,
  "waiting_on_author_days": 0,
  "days_since_update": 1
 },
 "refs": {
  "mentioned": [
   36167
  ],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 36167,
    "type": "pull",
    "state": "open",
    "merged": false,
    "merged_at": null,
    "title": "[RFC] Enable `-Wunused`"
   }
  ],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "Based on:\n* https://github.com/bitcoin-core/leveldb-subtree/pull/65\n* https://github.com/bitcoin-core/minisketch/pull/105\n* https://github.com/bitcoin-core/crc32c-subtree/pull/10\n\nPlease review those first.\n\nSplit out of #36167.\n\nFixes:\n```bash\n/root/bitcoin/src/leveldb/db/dbformat.h:42:18: warning: \u2018leveldb::config::kMaxMemCompactLevel\u2019 defined but not used [-Wunused-const-variable=]\n   42 | static const int kMaxMemCompactLevel = 2;\n      |                  ^~~~~~~~~~~~~~~~~~~\n/root/bitcoin/src/leveldb/db/dbformat.h:28:18: warning: \u2018leveldb::config::kL0_CompactionTrigger\u2019 defined but not used [-Wunused-const-variable=]\n   28 | static const int kL0_CompactionTrigger = 4;\n      |                  ^~~~~~~~~~~~~~~~~~~~~\nIn file included from /root/bitcoin/src/leveldb/db/dbformat.h:13:\n/root/bitcoin/src/leveldb/include/leveldb/db.h:19:18: warning: \u2018leveldb::kMinorVersion\u2019 defined but not used [-Wunused-const-variable=]\n   19 | static const int kMinorVersion = 22;\n      |                  ^~~~~~~~~~~~~\n/root/bitcoin/src/leveldb/include/leveldb/db.h:18:18: warning: \u2018leveldb::kMajorVersion\u2019 defined but not used [-Wunused-const-variable=]\n   18 | static const int kMajorVersion = 1;\n      |                  ^~~~~~~~~~~~~\n```\n\n```bash\nIn file included from /home/runner/work/_temp/src/init/common.cpp:11:\n/home/runner/work/_temp/src/logging.h:66:24: error: \u2018BCLog::RATELIMIT_MAX_BYTES\u2019 defined but not used [-Werror=unused-const-variable=]\n   66 |     constexpr uint64_t RATELIMIT_MAX_BYTES{1_MiB}; // maximum number of bytes per source location that can be logged within the RATELIMIT_WINDOW\n      |                        ^~~~~~~~~~~~~~~~~~~\ncc1plus: all warnings being treated as errors\n```\netc.",
 "commits": [
  {
   "sha": "e9d6f1cfdb06caa62892f6f44c00bc759631ee6c",
   "date": "2026-09-16T14:52:11Z",
   "message": "[nomerge] leveldb: inline constexpr\n\nSee https://github.com/bitcoin-core/leveldb-subtree/pull/65."
  },
  {
   "sha": "0c869b657522151d190d80a0baf87c0baca16ceb",
   "date": "2026-09-16T15:34:41Z",
   "message": "[nomerge] minisketch: inline constexpr\n\nhttps://github.com/bitcoin-core/minisketch/pull/105"
  },
  {
   "sha": "82b36289c48acb399402ee218531e481c22fa116",
   "date": "2026-09-16T15:34:45Z",
   "message": "[nomerge] crc32c: inline constexpr"
  },
  {
   "sha": "83e6d3e611148e721bceec3f22afb2fdae8dde4f",
   "date": "2026-09-16T15:34:45Z",
   "message": "refactor: use inline constexpr\n\nIn file included from /home/runner/work/_temp/src/init/common.cpp:11:\n/home/runner/work/_temp/src/logging.h:66:24: error: \u2018BCLog::RATELIMIT_MAX_BYTES\u2019 defined but not used [-Werror=unused-const-variable=]\n   66 |     constexpr uint64_t RATELIMIT_MAX_BYTES{1_MiB}; // maximum number of bytes per source location that can be logged within the RATELIMIT_WINDOW\n      |                        ^~~~~~~~~~~~~~~~~~~\ncc1plus: all warnings being treated as errors"
  },
  {
   "sha": "4d57fba4781e21bbba00ddb2e562e250b597395a",
   "date": "2026-09-16T15:34:45Z",
   "message": "build: add -Wunused-const-variable"
  }
 ],
 "timeline": [
  {
   "t": "2026-09-16T15:43:37Z",
   "kind": "force_push",
   "who": "fanquake",
   "commit": "4d57fba4781e21bbba00ddb2e562e250b597395a"
  }
 ],
 "labels_log": [
  {
   "t": "2026-09-16T15:14:53Z",
   "action": "labeled",
   "label": "Build system",
   "who": "DrahtBot"
  },
  {
   "t": "2026-09-16T15:45:05Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [],
 "text_chars": 2495,
 "text_tokens_estimate": 623,
 "changed_paths": [
  "CMakeLists.txt",
  "src/crc32c/src/crc32c_internal.h",
  "src/leveldb/db/dbformat.h",
  "src/leveldb/db/log_format.h",
  "src/leveldb/include/leveldb/db.h",
  "src/leveldb/table/format.h",
  "src/leveldb/util/crc32c.h",
  "src/logging.h",
  "src/minisketch/src/lintrans.h",
  "src/policy/fees/mempool_estimator.h"
 ],
 "files": [
  {
   "path": "CMakeLists.txt",
   "add": 1,
   "del": 0
  },
  {
   "path": "src/crc32c/src/crc32c_internal.h",
   "add": 1,
   "del": 1
  },
  {
   "path": "src/leveldb/db/dbformat.h",
   "add": 8,
   "del": 8
  },
  {
   "path": "src/leveldb/db/log_format.h",
   "add": 3,
   "del": 3
  },
  {
   "path": "src/leveldb/include/leveldb/db.h",
   "add": 2,
   "del": 2
  },
  {
   "path": "src/leveldb/table/format.h",
   "add": 2,
   "del": 2
  },
  {
   "path": "src/leveldb/util/crc32c.h",
   "add": 1,
   "del": 1
  },
  {
   "path": "src/logging.h",
   "add": 5,
   "del": 5
  },
  {
   "path": "src/minisketch/src/lintrans.h",
   "add": 4,
   "del": 1
  },
  {
   "path": "src/policy/fees/mempool_estimator.h",
   "add": 4,
   "del": 4
  }
 ],
 "test_lines": 0,
 "git": {
  "head": "4d57fba4781e21bbba00ddb2e562e250b597395a",
  "head_matches_backup": true,
  "base": "b8215855437288cac95c7fd5d41104c73c0f3495",
  "commits": [
   {
    "sha": "e9d6f1cfdb",
    "subject": "[nomerge] leveldb: inline constexpr",
    "files": 5,
    "add": 16,
    "del": 16
   },
   {
    "sha": "0c869b6575",
    "subject": "[nomerge] minisketch: inline constexpr",
    "files": 1,
    "add": 4,
    "del": 1
   },
   {
    "sha": "82b36289c4",
    "subject": "[nomerge] crc32c: inline constexpr",
    "files": 1,
    "add": 1,
    "del": 1
   },
   {
    "sha": "83e6d3e611",
    "subject": "refactor: use inline constexpr",
    "files": 2,
    "add": 9,
    "del": 9
   },
   {
    "sha": "4d57fba478",
    "subject": "build: add -Wunused-const-variable",
    "files": 1,
    "add": 1,
    "del": 0
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "654e7cc82003f8f0",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}