Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cast offset to size_t to avoid c++11-narrowing warning (#92)
e.g. with clang 18 on chimera linux: _CFFI_test_verify_anonymous_struct_with_star_typedef.cpp:583:10: error: non-constant-expression cannot be narrowed from type 'long' to 'size_t' (aka 'unsigned long') in initializer list [-Wc++11-narrowing] 583 | { "a", ((char *)&((foo_t)4096)->a) - (char *)4096, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _CFFI_test_verify_anonymous_struct_with_star_typedef.cpp:583:10: note: insert an explicit cast to silence this issue 583 | { "a", ((char *)&((foo_t)4096)->a) - (char *)4096, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | static_cast<size_t>( )
- Loading branch information