Skip to content

Commit 8fe844d

Browse files
Naveen KajeCruz Monrreal II
authored andcommitted
platform: fix build warning in mbed_error
Fix the following build warning Compile [ 83.4%]: mbed_error.c [Warning] mbed_error.c@71,21: 'compute_crc32' defined but not used [-Wunused-function] compute_crc32 usage is guraded with #define, but not the definition. Use the same #define around the definition of compute_crc32()
1 parent c4e6275 commit 8fe844d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

platform/mbed_error.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,14 @@ static core_util_atomic_flag halt_in_progress = CORE_UTIL_ATOMIC_FLAG_INIT;
4949
static int error_count = 0;
5050
static mbed_error_ctx first_error_ctx = {0};
5151

52+
static mbed_error_ctx last_error_ctx = {0};
53+
static mbed_error_hook_t error_hook = NULL;
54+
static mbed_error_status_t handle_error(mbed_error_status_t error_status, unsigned int error_value, const char *filename, int line_number, void *caller);
55+
5256
#if MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED
5357
//Global for populating the context in exception handler
5458
static mbed_error_ctx *const report_error_ctx = (mbed_error_ctx *)(ERROR_CONTEXT_LOCATION);
5559
static bool is_reboot_error_valid = false;
56-
#endif
57-
58-
static mbed_error_ctx last_error_ctx = {0};
59-
static mbed_error_hook_t error_hook = NULL;
60-
static mbed_error_status_t handle_error(mbed_error_status_t error_status, unsigned int error_value, const char *filename, int line_number, void *caller);
6160

6261
//Helper function to calculate CRC
6362
//NOTE: It would have been better to use MbedCRC implementation. But
@@ -88,6 +87,7 @@ static unsigned int compute_crc32(const void *data, int datalen)
8887

8988
return crc;
9089
}
90+
#endif
9191

9292
//Helper function to halt the system
9393
static MBED_NORETURN void mbed_halt_system(void)

0 commit comments

Comments
 (0)