The static inline declaration in iovec-fundamental.h causes static
analyze tooling warnings (clang-tidy). Let's get around it by making
free() non-inline. LTO will make sure it's still inlined properly.
/* Never try to read more than 16G into memory (and on 32bit 1G) */
#define FILE_READ_MAX MIN(SIZE_MAX/4, UINT64_C(16)*1024U*1024U*1024U)
+void free(void *p) {
+ if (!p)
+ return;
+
+ /* Debugging an invalid free requires trace logging to find the call site or a debugger attached. For
+ * release builds it is not worth the bother to even warn when we cannot even print a call stack. */
+#ifdef EFI_DEBUG
+ assert_se(BS->FreePool(p) == EFI_SUCCESS);
+#else
+ (void) BS->FreePool(p);
+#endif
+}
+
void convert_efi_path(char16_t *path) {
assert(path);
/* This is provided by the linker. */
extern uint8_t __executable_start[];
-static inline void free(void *p) {
- if (!p)
- return;
-
- /* Debugging an invalid free requires trace logging to find the call site or a debugger attached. For
- * release builds it is not worth the bother to even warn when we cannot even print a call stack. */
-#ifdef EFI_DEBUG
- assert_se(BS->FreePool(p) == EFI_SUCCESS);
-#else
- (void) BS->FreePool(p);
-#endif
-}
+DISABLE_WARNING_REDUNDANT_DECLS;
+void free(void *p);
+REENABLE_WARNING;
static inline void freep(void *p) {
free(*(void **) p);
};
DISABLE_WARNING_REDUNDANT_DECLS;
-static inline void free(void *p);
+void free(void *p);
REENABLE_WARNING;
#endif