Skip to content

Commit

Permalink
Changing type data_ to size_t which is more of concrete type because
Browse files Browse the repository at this point in the history
1. If lib is cross-compiled for win32 using MXE environment it cause
   compilation error -Wconversion on line 730 as sizeof(unsigned long)
   = 4 and sizeof(size_t) = 8
2. When lib is compiled on Unix like compiler generate error
   -Wuseless-cast if static_cast is used to fix issue in 1

Futher if size_t is not concrete type then, type data_ can be changed to
uint64_t or uint32_t because those have same sizes across all platforms
  • Loading branch information
vinayyadav3016 committed Oct 15, 2024
1 parent 83778bd commit e92c2d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ class basic_specs {
max_fill_size = 4
};

unsigned long data_ = 1 << fill_size_shift;
size_t data_ = 1 << fill_size_shift;

// Character (code unit) type is erased to prevent template bloat.
char fill_data_[max_fill_size] = {' '};
Expand Down

0 comments on commit e92c2d9

Please sign in to comment.