aaron.ballman added inline comments.
Comment at: clang/test/Sema/constant-conversion.c:30
+ s.b = 1; // one-bit-warning {{implicit truncation from 'int' to a
one-bit wide bit-field changes value from 1 to -1}}
+ s.b = true; // no-warning (we suppress it manually to reduce
bjope added inline comments.
Comment at: clang/test/Sema/constant-conversion.c:30
+ s.b = 1; // one-bit-warning {{implicit truncation from 'int' to a
one-bit wide bit-field changes value from 1 to -1}}
+ s.b = true; // no-warning (we suppress it manually to reduce false
aaron.ballman added inline comments.
Comment at: clang/test/Sema/constant-conversion.c:30
+ s.b = 1; // one-bit-warning {{implicit truncation from 'int' to a
one-bit wide bit-field changes value from 1 to -1}}
+ s.b = true; // no-warning (we suppress it manually to reduce
bjope added inline comments.
Comment at: clang/test/Sema/constant-conversion.c:30
+ s.b = 1; // one-bit-warning {{implicit truncation from 'int' to a
one-bit wide bit-field changes value from 1 to -1}}
+ s.b = true; // no-warning (we suppress it manually to reduce false
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3b00e486797c: Further update -Wbitfield-constant-conversion
for 1-bit bitfield (authored by aaron.ballman).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132
erichkeane accepted this revision.
erichkeane added a comment.
Still LGTM.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132851/new/
https://reviews.llvm.org/D132851
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.o
aaron.ballman updated this revision to Diff 456366.
aaron.ballman added a comment.
Update based on review feedback.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132851/new/
https://reviews.llvm.org/D132851
Files:
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/DiagnosticGrou
erichkeane accepted this revision.
erichkeane added a comment.
This revision is now accepted and ready to land.
2 nits, otherwise LGTM.
Comment at: clang/lib/Sema/SemaChecking.cpp:13080
- S.Diag(InitLoc, diag::warn_impcast_bitfield_precision_constant)
-<< PrettyValue <<
aaron.ballman updated this revision to Diff 456343.
aaron.ballman added a comment.
Added a test case for `true` in C++, and added similar logic for C to reduce
the chance for false positives. If the user uses `true` (the macro from
stdbool.h), they're signaling an intent that the field is used i
erichkeane added a comment.
LGTM, questioning whether we want to do some macro introspection in C mode (as
the CORRECT way to use these 1 bit-bitfields is as a bool), but at least this
gives the person the ability to disable this warning.
Comment at: clang/test/Sema/constant-
aaron.ballman created this revision.
aaron.ballman added reviewers: ShawnZhong, thakis, clang-language-wg,
erichkeane.
Herald added a project: All.
aaron.ballman requested review of this revision.
Herald added a project: clang.
https://reviews.llvm.org/D131255 (82afc9b169a67e8b8a1862fb9c41a2cd974
11 matches
Mail list logo