)]}'
{
  "commit": "4f1fae3043f22d3a2a0c7fcd7d0244cd91b60bdf",
  "tree": "9ee7cd87fb2dfa0e8fefb4f2b0327a511571feed",
  "parents": [
    "e21f272a664ab5785606d2caf5c78737458303e5"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Wed Dec 15 11:41:10 2021 -0500"
  },
  "committer": {
    "name": "Boringssl LUCI CQ",
    "email": "boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Wed Dec 15 22:59:35 2021 +0000"
  },
  "message": "Fix the easy -Wformat-signedness errors.\n\nGCC has a warning that complains about even more type mismatches in\nprintf. Some of these are a bit messy and will be fixed in separate CLs.\nThis covers the easy ones.\n\nThe .*s stuff is unfortunate, but printf has no size_t-clean string\nprinter. ALPN protocol lengths are bound by uint8_t, so it doesn\u0027t\nreally matter.\n\nThe IPv6 printing one is obnoxious and arguably a false positive. It\u0027s\nreally a C language flaw: all types smaller than int get converted to\nint when you do arithmetic. So something like this first doesn\u0027t\noverflow the shift because it computes over int, but then the result\noverall is stored as an int.\n\n  uint8_t a, b;\n  (a \u003c\u003c 8) | b\n\nOn the one hand, this fixes a \"missing\" cast to uint16_t before the\nshift. At the same time, the incorrect final type means passing it to\n%x, which expects unsigned int. The compiler has forgotten this value\nactually fits in uint16_t and flags a warning. Mitigate this by storing\nin a uint16_t first.\n\nThe story doesn\u0027t quite end here. Arguments passed to variadic functions\ngo through integer promotion[0], so the argument is still passed to\nsnprintf as an int! But then va_arg allows for a signedness mismatch[1],\nprovided the value is representable in both types. The combination means\nthat %x, though actually paired with unsigned, also accept uint8_t and\nuint16_t, because those are guaranteed to promote to an int that meets\n[1]. GCC recognizes [1] applies here.\n\n(There\u0027s also PRI16x, but that\u0027s a bit tedious to use and, in glibc, is\ndefined as plain \"x\" anyway.)\n\n[0] https://en.cppreference.com/w/c/language/conversion#Default_argument_promotions\n[1] https://en.cppreference.com/w/c/variadic/va_arg\n\nBug: 450\nChange-Id: Ic1d41356755a18ab922956dd2e07b560470341f4\nReviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/50765\nReviewed-by: Adam Langley \u003cagl@google.com\u003e\nCommit-Queue: Adam Langley \u003cagl@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4682131615538bc957405854159a19a2f7621d93",
      "old_mode": 33188,
      "old_path": "crypto/dsa/dsa_test.cc",
      "new_id": "cee783d6c23ca70c1b4820d05e4a5cdb73ad5c19",
      "new_mode": 33188,
      "new_path": "crypto/dsa/dsa_test.cc"
    },
    {
      "type": "modify",
      "old_id": "3621d5f2c77f492dbb3201ae29f15d58d06b65fc",
      "old_mode": 33188,
      "old_path": "crypto/evp/print.c",
      "new_id": "0f4b65ea182dd1c944010eb99e656f5074fb8813",
      "new_mode": 33188,
      "new_path": "crypto/evp/print.c"
    },
    {
      "type": "modify",
      "old_id": "b9e900751c5b2088283c46fb3ae8de1db89ed859",
      "old_mode": 33188,
      "old_path": "crypto/fipsmodule/rand/urandom_test.cc",
      "new_id": "0a1d7539cde0c83b962c761d09704bc644dce358",
      "new_mode": 33188,
      "new_path": "crypto/fipsmodule/rand/urandom_test.cc"
    },
    {
      "type": "modify",
      "old_id": "ce1c6e5825f6daac398e6544c2050c7d1e55e889",
      "old_mode": 33188,
      "old_path": "crypto/x509v3/v3_alt.c",
      "new_id": "eb9c9757aa42f0ed16f4aa7df5ceffbd6b17eec1",
      "new_mode": 33188,
      "new_path": "crypto/x509v3/v3_alt.c"
    },
    {
      "type": "modify",
      "old_id": "739a59ec9d863984dfd71432120047c8137150b9",
      "old_mode": 33188,
      "old_path": "crypto/x509v3/v3_ncons.c",
      "new_id": "f58873e6580392fff76f6a33b65a73faf503b091",
      "new_mode": 33188,
      "new_path": "crypto/x509v3/v3_ncons.c"
    },
    {
      "type": "modify",
      "old_id": "8462ebf007b22239e4b98eee471dac5a630bb461",
      "old_mode": 33188,
      "old_path": "ssl/ssl_privkey.cc",
      "new_id": "41a13a24ac36c931ffaa94ebf9c534d231911b34",
      "new_mode": 33188,
      "new_path": "ssl/ssl_privkey.cc"
    },
    {
      "type": "modify",
      "old_id": "d0bd680e19e6a220f361e3380d185281a09f40a0",
      "old_mode": 33188,
      "old_path": "ssl/ssl_test.cc",
      "new_id": "3286081891a8b5b0f58555a90327e1845eedc4fe",
      "new_mode": 33188,
      "new_path": "ssl/ssl_test.cc"
    },
    {
      "type": "modify",
      "old_id": "b9998317bccd699ef34eb5471531cadbb8cc4bed",
      "old_mode": 33188,
      "old_path": "ssl/test/handshake_util.cc",
      "new_id": "6516547fa85b549500828428091021aaab370095",
      "new_mode": 33188,
      "new_path": "ssl/test/handshake_util.cc"
    },
    {
      "type": "modify",
      "old_id": "7d1cefa16ed757cba826a0590abc7dbcb284793a",
      "old_mode": 33188,
      "old_path": "ssl/test/test_config.cc",
      "new_id": "16cb97198bd371d87a47cd93d6f7b86db9258885",
      "new_mode": 33188,
      "new_path": "ssl/test/test_config.cc"
    },
    {
      "type": "modify",
      "old_id": "cba3c7b9cc2f4f77cfb62366bebff9352821eafe",
      "old_mode": 33188,
      "old_path": "tool/transport_common.cc",
      "new_id": "991c808a236d21ba7be419676a2b6ea26a4babb0",
      "new_mode": 33188,
      "new_path": "tool/transport_common.cc"
    }
  ]
}
