/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "analyze.h"
#include "analyze-verify-util.h"
#include "execute.h"
#include "tests.h"
static DLSYM_PROTOTYPE(LZ4F_isError) = NULL;
static DLSYM_PROTOTYPE(LZ4_compress_HC) = NULL;
/* These are used in test-compress.c so we don't make them static. */
+// NOLINTBEGIN(misc-use-internal-linkage)
DLSYM_PROTOTYPE(LZ4_compress_default) = NULL;
DLSYM_PROTOTYPE(LZ4_decompress_safe) = NULL;
DLSYM_PROTOTYPE(LZ4_decompress_safe_partial) = NULL;
DLSYM_PROTOTYPE(LZ4_versionNumber) = NULL;
+// NOLINTEND(misc-use-internal-linkage)
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(LZ4F_compressionContext_t, sym_LZ4F_freeCompressionContext, LZ4F_freeCompressionContextp, NULL);
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(LZ4F_decompressionContext_t, sym_LZ4F_freeDecompressionContext, LZ4F_freeDecompressionContextp, NULL);
/* This is intended to carry data, not to be executed */
+// NOLINTNEXTLINE(misc-use-internal-linkage)
EFIAPI EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *system_table);
EFIAPI EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *system_table) {
return EFI_UNSUPPORTED;
}
}
+// NOLINTNEXTLINE(misc-use-internal-linkage)
DEFINE_EFI_MAIN_FUNCTION(run, "systemd-boot", /* wait_for_debugger= */ false);
log_count = 0;
}
+// NOLINTNEXTLINE(misc-use-internal-linkage)
_used_ intptr_t __stack_chk_guard = (intptr_t) 0x70f6967de78acae3;
/* We can only set a random stack canary if this function attribute is available,
}
#endif
+// NOLINTBEGIN(misc-use-internal-linkage)
_used_ _noreturn_ void __stack_chk_fail(void);
_used_ _noreturn_ void __stack_chk_fail_local(void);
+// NOLINTEND(misc-use-internal-linkage)
void __stack_chk_fail(void) {
panic(u"systemd-boot: Stack check failed, halting.");
}
}
/* Called by libgcc for some fatal errors like integer overflow with -ftrapv. */
+// NOLINTNEXTLINE(misc-use-internal-linkage)
_used_ _noreturn_ void abort(void);
void abort(void) {
panic(u"systemd-boot: Unknown error, halting.");
#if defined(__ARM_EABI__)
/* These override the (weak) div0 handlers from libgcc as they would otherwise call raise() instead. */
+// NOLINTBEGIN(misc-use-internal-linkage)
_used_ _noreturn_ int __aeabi_idiv0(int return_value);
_used_ _noreturn_ long long __aeabi_ldiv0(long long return_value);
+// NOLINTEND(misc-use-internal-linkage)
int __aeabi_idiv0(int return_value) {
panic(u"systemd-boot: Division by zero, halting.");
# undef memcmp
# undef memcpy
# undef memset
+// NOLINTBEGIN(misc-use-internal-linkage)
_used_ void *memchr(const void *p, int c, size_t n);
_used_ int memcmp(const void *p1, const void *p2, size_t n);
_used_ void *memcpy(void * restrict dest, const void * restrict src, size_t n);
_used_ void *memset(void *p, int c, size_t n);
+// NOLINTEND(misc-use-internal-linkage)
#else
/* And for userspace unit testing we need to give them an efi_ prefix. */
# undef memchr
#include <stddef.h>
#include <stdint.h>
+// NOLINTNEXTLINE(misc-use-internal-linkage)
const uint8_t hwids_section_data[] = {
""",
end='',
print(
"""};
+
+// NOLINTNEXTLINE(misc-use-internal-linkage)
const size_t hwids_section_len =""",
f'{len(hwids)};',
)
return err;
}
+// NOLINTNEXTLINE(misc-use-internal-linkage)
DEFINE_EFI_MAIN_FUNCTION(run, "systemd-stub", /* wait_for_debugger= */ false);
int netmask_offset;
int ip_offset;
};
-struct bootp_addr_data *bootp_test_context;
+static struct bootp_addr_data *bootp_test_context;
static bool verbose = true;
static int test_fd[2];
assert_se(sd_bus_error_set(NULL, "System.Error.WHATSIT", NULL) == -EIO);
}
-BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map test_errors[] = {
+BUS_ERROR_MAP_ELF_REGISTER static const sd_bus_error_map test_errors[] = {
SD_BUS_ERROR_MAP("org.freedesktop.custom-dbus-error", 5),
SD_BUS_ERROR_MAP("org.freedesktop.custom-dbus-error-2", 52),
SD_BUS_ERROR_MAP_END
};
-BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map test_errors2[] = {
+BUS_ERROR_MAP_ELF_REGISTER static const sd_bus_error_map test_errors2[] = {
SD_BUS_ERROR_MAP("org.freedesktop.custom-dbus-error-3", 33),
SD_BUS_ERROR_MAP("org.freedesktop.custom-dbus-error-4", 44),
SD_BUS_ERROR_MAP("org.freedesktop.custom-dbus-error-33", 333),
#include "chid-fundamental.h"
#include "tests.h"
-const char16_t *const test_fields[_CHID_SMBIOS_FIELDS_MAX] = {
+static const char16_t *const test_fields[_CHID_SMBIOS_FIELDS_MAX] = {
[CHID_SMBIOS_MANUFACTURER] = u"Micro-Star International Co., Ltd.",
[CHID_SMBIOS_PRODUCT_NAME] = u"MS-7D70",
[CHID_SMBIOS_PRODUCT_SKU] = u"To be filled by O.E.M.",
return 0;
}
-const gather_stdout_callback_t gather_stdouts[] = {
+static const gather_stdout_callback_t gather_stdouts[] = {
gather_stdout_one,
gather_stdout_two,
gather_stdout_three,
#include "hashmap.h"
#include "tests.h"
+// NOLINTNEXTLINE(misc-use-internal-linkage)
unsigned custom_counter = 0;
static void custom_destruct(void* p) {
custom_counter--;
free(p);
}
+// NOLINTBEGIN(misc-use-internal-linkage)
DEFINE_HASH_OPS_FULL(boring_hash_ops, char, string_hash_func, string_compare_func, free, char, free);
DEFINE_HASH_OPS_FULL(custom_hash_ops, char, string_hash_func, string_compare_func, custom_destruct, char, custom_destruct);
+// NOLINTEND(misc-use-internal-linkage)
TEST(ordered_hashmap_next) {
_cleanup_ordered_hashmap_free_ OrderedHashmap *m = NULL;
* they don't apply to ordered hashmaps. */
/* This variable allows us to assert that the tests from different compilation units were actually run. */
+// NOLINTNEXTLINE(misc-use-internal-linkage)
int n_extern_tests_run = 0;
static int intro(void) {
STATIC_DESTRUCTOR_REGISTER(runtime_dir, rm_rf_physical_and_freep);
/* For testing type compatibility. */
-_unused_ ConfigPerfItemLookup unused_lookup = load_fragment_gperf_lookup;
+_unused_ static ConfigPerfItemLookup unused_lookup = load_fragment_gperf_lookup;
TEST_RET(unit_file_get_list) {
int r;