mirror of
https://github.com/serge1/COFFI
synced 2026-06-08 17:24:32 +00:00
master
C4244/C4267: Instead of manually expanding macros at each call site, fix the COFFI_SET_ACCESS and COFFI_GET_SET_ACCESS macros to use narrow_cast<decltype(header.NAME)>(value) in the setter. This handles all narrowing conversions (uint64_t->uint32_t in win_header_pe, uint32_t->uint16_t in section_header, size_t->uint32_t) globally. Revert the previous manual expansions for reloc_count/line_num_count back to macro usage since the macro now handles it. C4250: Suppress the diamond virtual inheritance dominance warning with a comment explaining the design: coffi_strings and coffi_symbols both virtually inherit string_to_name_provider, and the dominant path through coffi_strings is the intended resolution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
COFFI
COFFI is a header-only C++ library intended for reading and generating files in Common Object File Format (COFF). It is used as a standalone library - it is not dependant on any other product or project. Adhering to ISO C++ (C++14 and newer), it compiles on a wide variety of architectures and compilers.
As the COFF binary format standard is extended or violated in many implementations, this library only supports a very small subset of the COFF implementations, including:
- Windows portable executable (PE) format
- Texas Instruments COFF
- CEVA, Inc COFF
The full library documentation can be found in COFFI - Tutorial and User Manual.
Description
Languages
C++
46%
Python
36.3%
C
16.8%
CMake
0.9%