From 6370f51af0a9beb6cc90de3d5cd1955e34ae6204 Mon Sep 17 00:00:00 2001 From: Thomas Kuschel Date: Sat, 16 Jul 2022 01:58:08 +0200 Subject: [PATCH] suppress not used variables --- Core/Src/syscalls.c | 21 +++++++++++++++++++ .../Src/stm32l4xx_hal_exti.c | 2 ++ 2 files changed, 23 insertions(+) diff --git a/Core/Src/syscalls.c b/Core/Src/syscalls.c index fadb992..4a81b3b 100644 --- a/Core/Src/syscalls.c +++ b/Core/Src/syscalls.c @@ -52,6 +52,8 @@ int _getpid(void) int _kill(int pid, int sig) { + (void)pid; + (void)sig; errno = EINVAL; return -1; } @@ -65,6 +67,7 @@ void _exit (int status) __attribute__((weak)) int _read(int file, char *ptr, int len) { int DataIdx; + (void)file; for (DataIdx = 0; DataIdx < len; DataIdx++) { @@ -77,6 +80,7 @@ return len; __attribute__((weak)) int _write(int file, char *ptr, int len) { int DataIdx; + (void)file; for (DataIdx = 0; DataIdx < len; DataIdx++) { @@ -87,57 +91,71 @@ __attribute__((weak)) int _write(int file, char *ptr, int len) int _close(int file) { + (void)file; return -1; } int _fstat(int file, struct stat *st) { + (void)file; st->st_mode = S_IFCHR; return 0; } int _isatty(int file) { + (void)file; return 1; } int _lseek(int file, int ptr, int dir) { + (void)file; + (void)ptr; + (void)dir; return 0; } int _open(char *path, int flags, ...) { + (void)path; + (void)flags; /* Pretend like we always fail */ return -1; } int _wait(int *status) { + (void)status; errno = ECHILD; return -1; } int _unlink(char *name) { + (void)name; errno = ENOENT; return -1; } int _times(struct tms *buf) { + (void)buf; return -1; } int _stat(char *file, struct stat *st) { + (void)file; st->st_mode = S_IFCHR; return 0; } int _link(char *old, char *new) { + (void)old; + (void)new; errno = EMLINK; return -1; } @@ -150,6 +168,9 @@ int _fork(void) int _execve(char *name, char **argv, char **env) { + (void)name; + (void)argv; + (void)env; errno = ENOMEM; return -1; } diff --git a/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c b/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c index fb1afae..726e1c5 100644 --- a/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c +++ b/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c @@ -537,6 +537,7 @@ uint32_t HAL_EXTI_GetPending(EXTI_HandleTypeDef *hexti, uint32_t Edge) uint32_t linepos; uint32_t maskline; uint32_t offset; + (void)Edge; /* Check parameters */ assert_param(IS_EXTI_LINE(hexti->Line)); @@ -571,6 +572,7 @@ void HAL_EXTI_ClearPending(EXTI_HandleTypeDef *hexti, uint32_t Edge) __IO uint32_t *regaddr; uint32_t maskline; uint32_t offset; + (void)Edge; /* Check parameters */ assert_param(IS_EXTI_LINE(hexti->Line));