-
Type: Technical Debt
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Storage Engines
The coding standard utilizes a double underscore {} _as a prefix for its naming convention, for example __wt_evict_file.
This is in violation of the standard C11 7.1.3:
All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.
This is not purely a theoretical standards compliance concern, for example, MSan tooling injects symbols with the prefix __msan (see below).
Defining these reserved identifiers is labelled as undefined behavior, though pragmatically it seems the most likely outcome is a link time failure.
Given the age and distribution of the project has not resulted in any known problem, the likelihood that a problem will arise in the future appears to be negligible. Regardless, this violation of the standard should be considered, and the conclusion documented.
$ cmake -G Ninja .. -DCMAKE_BUILD_TYPE=MSan $ objdump -t libwiredtiger.so.11.2.0 | grep __msan 0000000000000000 *UND* 0000000000000000 __msan_va_arg_overflow_size_tls 0000000000000000 *UND* 0000000000000000 __msan_memmove 0000000000000000 *UND* 0000000000000000 __msan_memcpy 0000000000000000 *UND* 0000000000000000 __msan_set_alloca_origin4 00000000007da484 w O .rodata 0000000000000004 __msan_track_origins 0000000000000000 *UND* 0000000000000000 __msan_retval_origin_tls 0000000000000000 *UND* 0000000000000000 __msan_chain_origin 0000000000000000 *UND* 0000000000000000 __msan_init 0000000000000000 *UND* 0000000000000000 __msan_param_origin_tls 0000000000000000 *UND* 0000000000000000 __msan_memset 0000000000000000 *UND* 0000000000000000 __msan_warning_with_origin_noreturn 0000000000000000 *UND* 0000000000000000 __msan_retval_tls 0000000000000000 *UND* 0000000000000000 __msan_param_tls 0000000000000000 *UND* 0000000000000000 __msan_va_arg_tls