Skip to content

Commit

Permalink
Fixed all clang -Wsigned-enum-bitfield warnings
Browse files Browse the repository at this point in the history
Made enums involved in bitfields unsigned.

Used unsigned char specifically because gcc before 9.3 seems to have a bug where it warns about bitfields not being big enough to hold the enum, even though they are.
  • Loading branch information
seanm committed Mar 15, 2022
1 parent bc654fa commit 5a049f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -2002,11 +2002,11 @@ using format_args = basic_format_args<format_context>;
// We cannot use enum classes as bit fields because of a gcc bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414.
namespace align {
enum type { none, left, right, center, numeric };
enum type : unsigned char { none, left, right, center, numeric };
}
using align_t = align::type;
namespace sign {
enum type { none, minus, plus, space };
enum type : unsigned char { none, minus, plus, space };
}
using sign_t = sign::type;

Expand Down

0 comments on commit 5a049f0

Please sign in to comment.