[FL-2520] FW build with -Wextra (#1185)

* Fixing compiler warnings with -Wextra
* More warnings suppression, WIP
* Even more warning fixes
* Added new lines at end of text files.
* Padding fix
* Additional fixes to warnings on different build configurations; added -Wextra to default build pipeline
* Fixes for Secplus v1
* -additional warnings
* +-Wredundant-decls fixes
* FuriHal: print stack overflow task name in console
* FuriHal: add missing include

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
hedger
2022-05-06 16:37:10 +03:00
committed by GitHub
parent 1ca98170d9
commit 4d6b170769
461 changed files with 940 additions and 519 deletions

View File

@@ -334,4 +334,4 @@ MU_TEST_SUITE(flipper_format_string_suite) {
int run_minunit_test_flipper_format_string() {
MU_RUN_SUITE(flipper_format_string_suite);
return MU_EXIT_CODE;
}
}

View File

@@ -42,4 +42,4 @@ void test_furi_pubsub() {
// delete pubsub case
furi_pubsub_free(test_pubsub);
}
}

View File

@@ -55,7 +55,7 @@ static void run_encoder_fill_array(
bool level = false;
bool level_read;
InfraredStatus status = InfraredStatusError;
int i = 0;
size_t i = 0;
bool first = true;
while(1) {
@@ -100,7 +100,7 @@ static void run_encoder(
run_encoder_fill_array(encoder_handler, timings, &timings_len, NULL);
furi_check(timings_len <= 200);
for(int i = 0; i < timings_len; ++i, ++j) {
for(size_t i = 0; i < timings_len; ++i, ++j) {
mu_check(MATCH_TIMING(timings[i], expected_timings[j], 120));
mu_assert(j < expected_timings_len, "encoded more timings than expected");
}
@@ -127,7 +127,7 @@ static void
furi_check(timings_len <= 200);
const InfraredMessage* message_decoded = 0;
for(int i = 0; i < timings_len; ++i) {
for(size_t i = 0; i < timings_len; ++i) {
message_decoded = infrared_decode(decoder_handler, level, timings[i]);
if((i == timings_len - 2) && level && message_decoded) {
/* In case we end with space timing - message can be decoded at last mark */

View File

@@ -12,4 +12,4 @@ double minunit_real_timer = 0;
double minunit_proc_timer = 0;
/* Last message */
char minunit_last_message[MINUNIT_MESSAGE_LEN];
char minunit_last_message[MINUNIT_MESSAGE_LEN];

View File

@@ -12,4 +12,4 @@ extern double minunit_real_timer;
extern double minunit_proc_timer;
/* Last message */
extern char minunit_last_message[MINUNIT_MESSAGE_LEN];
extern char minunit_last_message[MINUNIT_MESSAGE_LEN];

View File

@@ -45,7 +45,7 @@ static RpcSessionContext rpc_session[TEST_RPC_SESSIONS];
#define TAG "UnitTestsRpc"
#define MAX_RECEIVE_OUTPUT_TIMEOUT 3000
#define MAX_NAME_LENGTH 255
#define MAX_DATA_SIZE 512 // have to be exact as in rpc_storage.c
#define MAX_DATA_SIZE 512u // have to be exact as in rpc_storage.c
#define TEST_DIR TEST_DIR_NAME "/"
#define TEST_DIR_NAME "/ext/unit_tests_tmp"
#define MD5SUM_SIZE 16
@@ -217,6 +217,8 @@ static void test_rpc_print_message_list(MsgList_t msg_list) {
rpc_print_message(msg);
}
MsgList_reverse(msg_list);
#else
UNUSED(msg_list);
#endif
}
@@ -494,7 +496,7 @@ static void test_rpc_compare_messages(PB_Main* result, PB_Main* expected) {
size_t expected_msg_files = expected->content.storage_list_response.file_count;
size_t result_msg_files = result->content.storage_list_response.file_count;
mu_check(result_msg_files == expected_msg_files);
for(int i = 0; i < expected_msg_files; ++i) {
for(size_t i = 0; i < expected_msg_files; ++i) {
PB_Storage_File* result_msg_file = &result->content.storage_list_response.file[i];
PB_Storage_File* expected_msg_file = &expected->content.storage_list_response.file[i];
test_rpc_compare_file(result_msg_file, expected_msg_file);
@@ -794,7 +796,7 @@ static void test_create_file(const char* path, size_t size) {
if(storage_file_open(file, path, FSAM_WRITE, FSOM_CREATE_ALWAYS)) {
uint8_t buf[128] = {0};
for(int i = 0; i < sizeof(buf); ++i) {
for(size_t i = 0; i < sizeof(buf); ++i) {
buf[i] = '0' + (i % 10);
}
while(size) {
@@ -928,7 +930,7 @@ static void test_storage_write_run(
MsgList_init(expected_msg_list);
uint8_t* buf = malloc(write_size);
for(int i = 0; i < write_size; ++i) {
for(size_t i = 0; i < write_size; ++i) {
buf[i] = '0' + (i % 10);
}
@@ -1551,8 +1553,9 @@ MU_TEST_SUITE(test_rpc_app) {
static void
test_send_rubbish(RpcSession* session, const char* pattern, size_t pattern_size, size_t size) {
UNUSED(session);
uint8_t* buf = malloc(size);
for(int i = 0; i < size; ++i) {
for(size_t i = 0; i < size; ++i) {
buf[i] = pattern[i % pattern_size];
}

View File

@@ -168,4 +168,4 @@ int run_minunit_test_storage() {
MU_RUN_SUITE(storage_file);
MU_RUN_SUITE(storage_dir);
return MU_EXIT_CODE;
}
}

View File

@@ -378,4 +378,4 @@ MU_TEST_SUITE(stream_suite) {
int run_minunit_test_stream() {
MU_RUN_SUITE(stream_suite);
return MU_EXIT_CODE;
}
}

View File

@@ -26,6 +26,8 @@ static void subghz_test_rx_callback(
SubGhzReceiver* receiver,
SubGhzProtocolDecoderBase* decoder_base,
void* context) {
UNUSED(receiver);
UNUSED(context);
string_t text;
string_init(text);
subghz_protocol_decoder_base_get_string(decoder_base, text);

View File

@@ -35,6 +35,9 @@ void minunit_print_fail(const char* str) {
}
void unit_tests_cli(Cli* cli, string_t args, void* context) {
UNUSED(cli);
UNUSED(args);
UNUSED(context);
uint32_t test_result = 0;
minunit_run = 0;
minunit_assert = 0;