[PATCH] D71142: [Sema] Validate large bitfields

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 6 13:48:19 PST 2019


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:5186-5189
+def warn_bitfield_width_exceeds_maximum_width: Error<
+  "width of bit-field %0 doesn't fit in a 64 bit unsigned integer">;
+def warn_anon_bitfield_width_exceeds_maximum_width : Error<
+  "width of anonymous bit-field doesn't fit in a 64 bit unsigned integer">;
----------------
I feel like this situation should be an error rather than a warning -- what could the code possibly have meant?


================
Comment at: clang/lib/Sema/SemaDecl.cpp:15845
 
+    // Don't accept too wide bit-fields they will cause assertion failures
+    // when used.
----------------
too wide -> too-wide
bit-fields they -> bit-fields, they


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71142/new/

https://reviews.llvm.org/D71142





More information about the cfe-commits mailing list