diff --git a/ports/broadcom/Makefile b/ports/broadcom/Makefile index 240362e3de7f6..f60ebbf045e1f 100644 --- a/ports/broadcom/Makefile +++ b/ports/broadcom/Makefile @@ -95,7 +95,7 @@ else endif -CFLAGS += $(INC) -Wall -Werror -std=gnu11 $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) $(DISABLE_WARNINGS) +CFLAGS += $(INC) -Wall -Werror -std=gnu11 $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) $(DISABLE_WARNINGS) -Werror=old-style-definition $(BUILD)/lib/tlsf/tlsf.o: CFLAGS += -Wno-cast-align diff --git a/ports/cxd56/common-hal/camera/Camera.c b/ports/cxd56/common-hal/camera/Camera.c index c3c935a168d42..b9fa2787ef767 100644 --- a/ports/cxd56/common-hal/camera/Camera.c +++ b/ports/cxd56/common-hal/camera/Camera.c @@ -44,7 +44,7 @@ static const image_size_t isx019_image_size_table[] = { { VIDEO_HSIZE_QUADVGA, VIDEO_VSIZE_QUADVGA }, }; -static const char *get_imgsensor_name() { +static const char *get_imgsensor_name(void) { static struct v4l2_capability cap; ioctl(camera_dev.fd, VIDIOC_QUERYCAP, (unsigned long)&cap); @@ -113,7 +113,7 @@ static void camera_start_streaming(enum v4l2_buf_type type) { ioctl(camera_dev.fd, VIDIOC_STREAMON, (unsigned long)&type); } -static void camera_start_preview() { +static void camera_start_preview(void) { camera_set_format(V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_PIX_FMT_UYVY, VIDEO_HSIZE_QVGA, VIDEO_VSIZE_QVGA); v4l2_buffer_t buf; diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 542083188e556..09522ea795050 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -191,7 +191,7 @@ endif # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk CFLAGS += $(OPTIMIZATION_FLAGS) -CFLAGS += $(INC) -Werror -Wall -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes +CFLAGS += $(INC) -Werror -Wall -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes -Werror=old-style-definition # Most current ESPs have nano versions of newlib in ROM so we use them. ifneq ($(IDF_TARGET),esp32c6) diff --git a/ports/espressif/common-hal/_bleio/__init__.c b/ports/espressif/common-hal/_bleio/__init__.c index f3637a8fddb99..119fe55921e8a 100644 --- a/ports/espressif/common-hal/_bleio/__init__.c +++ b/ports/espressif/common-hal/_bleio/__init__.c @@ -31,7 +31,7 @@ static uint64_t _timeout_start_time; background_callback_t bleio_background_callback; -void bleio_user_reset() { +void bleio_user_reset(void) { // Stop any user scanning or advertising. common_hal_bleio_adapter_stop_scan(&common_hal_bleio_adapter_obj); common_hal_bleio_adapter_stop_advertising(&common_hal_bleio_adapter_obj); @@ -43,7 +43,7 @@ void bleio_user_reset() { } // Turn off BLE on a reset or reload. -void bleio_reset() { +void bleio_reset(void) { // Set this explicitly to save data. if (!common_hal_bleio_adapter_get_enabled(&common_hal_bleio_adapter_obj)) { return; diff --git a/ports/espressif/common-hal/sdioio/SDCard.c b/ports/espressif/common-hal/sdioio/SDCard.c index 6fd27c289459c..87ba32f802095 100644 --- a/ports/espressif/common-hal/sdioio/SDCard.c +++ b/ports/espressif/common-hal/sdioio/SDCard.c @@ -245,7 +245,7 @@ void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self) { } } -void sdioio_reset() { +void sdioio_reset(void) { for (size_t i = 0; i < MP_ARRAY_SIZE(slot_in_use); i++) { if (!never_reset_sdio[i]) { slot_in_use[i] = false; diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index e72eab7e32a56..121335245dc33 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -461,11 +461,11 @@ void port_disable_tick(void) { esp_timer_stop(_tick_timer); } -void port_wake_main_task() { +void port_wake_main_task(void) { xTaskNotifyGive(circuitpython_task); } -void port_wake_main_task_from_isr() { +void port_wake_main_task_from_isr(void) { BaseType_t xHigherPriorityTaskWoken = pdFALSE; vTaskNotifyGiveFromISR(circuitpython_task, &xHigherPriorityTaskWoken); if (xHigherPriorityTaskWoken == pdTRUE) { @@ -473,7 +473,7 @@ void port_wake_main_task_from_isr() { } } -void port_yield() { +void port_yield(void) { vTaskDelay(4); } diff --git a/ports/litex/Makefile b/ports/litex/Makefile index bb1d88e755201..98abe985699cf 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -38,7 +38,7 @@ endif # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk CFLAGS += $(OPTIMIZATION_FLAGS) -CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes +CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes -Werror=old-style-definition # TODO: check this CFLAGS += -D__START=main -DFOMU diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 57a8beb069129..e6928eead619d 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -45,7 +45,7 @@ ifeq ($(DEBUG), 1) CFLAGS += -fno-ipa-sra endif -CFLAGS += $(INC) -ggdb -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes +CFLAGS += $(INC) -ggdb -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes -Werror=old-style-definition # TODO: add these when -Werror is applied # Disable some warnings, as do most ports. NXP SDK causes undef, tinyusb causes cast-align diff --git a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c index 196e52dbf0369..f1030bfcd848c 100644 --- a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c +++ b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c @@ -439,6 +439,6 @@ void port_i2s_resume(i2s_t *self) { self->paused = false; } -void i2s_reset() { +void i2s_reset(void) { // this port relies on object finalizers for reset } diff --git a/ports/nordic/Makefile b/ports/nordic/Makefile index e60b4072a8d48..aa614e097ba3c 100755 --- a/ports/nordic/Makefile +++ b/ports/nordic/Makefile @@ -47,7 +47,7 @@ endif # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk CFLAGS += $(OPTIMIZATION_FLAGS) -CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes +CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes -Werror=old-style-definition # Nordic Softdevice SDK header files contains inline assembler that has # broken constraints. As a result the IPA-modref pass, introduced in gcc-11, diff --git a/ports/nordic/common-hal/_bleio/__init__.c b/ports/nordic/common-hal/_bleio/__init__.c index 095723194cfbf..454937dcd354a 100644 --- a/ports/nordic/common-hal/_bleio/__init__.c +++ b/ports/nordic/common-hal/_bleio/__init__.c @@ -80,7 +80,7 @@ void check_sec_status(uint8_t sec_status) { void common_hal_bleio_init(void) { } -void bleio_user_reset() { +void bleio_user_reset(void) { if (common_hal_bleio_adapter_get_enabled(&common_hal_bleio_adapter_obj)) { // Stop any user scanning or advertising. common_hal_bleio_adapter_stop_scan(&common_hal_bleio_adapter_obj); @@ -94,7 +94,7 @@ void bleio_user_reset() { } // Turn off BLE on a reset or reload. -void bleio_reset() { +void bleio_reset(void) { // Set this explicitly to save data. common_hal_bleio_adapter_obj.base.type = &bleio_adapter_type; if (!common_hal_bleio_adapter_get_enabled(&common_hal_bleio_adapter_obj)) { diff --git a/ports/nordic/common-hal/audiopwmio/PWMAudioOut.c b/ports/nordic/common-hal/audiopwmio/PWMAudioOut.c index 53be11bcd7485..b48a03e09c601 100644 --- a/ports/nordic/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nordic/common-hal/audiopwmio/PWMAudioOut.c @@ -136,7 +136,7 @@ static void audiopwmout_background_obj(audiopwmio_pwmaudioout_obj_t *self) { } } -void audiopwmout_background() { +void audiopwmout_background(void) { // Check the NVIC first because it is part of the CPU and fast to read. if (!NVIC_GetPendingIRQ(PWM0_IRQn) && !NVIC_GetPendingIRQ(PWM1_IRQn) && diff --git a/ports/nordic/common-hal/microcontroller/__init__.c b/ports/nordic/common-hal/microcontroller/__init__.c index 38a3b1ee60938..fbb40afe0449d 100644 --- a/ports/nordic/common-hal/microcontroller/__init__.c +++ b/ports/nordic/common-hal/microcontroller/__init__.c @@ -35,7 +35,7 @@ void common_hal_mcu_delay_us(uint32_t delay) { static volatile uint32_t nesting_count = 0; static uint8_t is_nested_critical_region; -void common_hal_mcu_disable_interrupts() { +void common_hal_mcu_disable_interrupts(void) { if (nesting_count == 0) { // Unlike __disable_irq(), this should only be called the first time // "is_nested_critical_region" is sd's equivalent of our nesting count @@ -51,7 +51,7 @@ void common_hal_mcu_disable_interrupts() { nesting_count++; } -void common_hal_mcu_enable_interrupts() { +void common_hal_mcu_enable_interrupts(void) { if (nesting_count == 0) { // This is very very bad because it means there was mismatched disable/enables. reset_into_safe_mode(SAFE_MODE_INTERRUPT_ERROR); diff --git a/ports/renode/Makefile b/ports/renode/Makefile index 22e32f9d2fb6e..92541c03e77b9 100644 --- a/ports/renode/Makefile +++ b/ports/renode/Makefile @@ -21,7 +21,7 @@ INC += \ CFLAGS += -ggdb3 -Os DISABLE_WARNINGS = -Wno-cast-align -CFLAGS += $(INC) -Wall -Werror -std=gnu11 -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) $(DISABLE_WARNINGS) -Werror=missing-prototypes +CFLAGS += $(INC) -Wall -Werror -std=gnu11 -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) $(DISABLE_WARNINGS) -Werror=missing-prototypes -Werror=old-style-definition CFLAGS += \ -march=armv6-m \ diff --git a/ports/renode/supervisor/port.c b/ports/renode/supervisor/port.c index dae32b7bb8f2d..d12ebd2efddb9 100644 --- a/ports/renode/supervisor/port.c +++ b/ports/renode/supervisor/port.c @@ -210,7 +210,7 @@ __attribute__((used)) void HardFault_Handler(void) { } } -void port_yield() { +void port_yield(void) { } void port_boot_info(void) { diff --git a/ports/silabs/boards/devkit_xg24_brd2601b/sensor.c b/ports/silabs/boards/devkit_xg24_brd2601b/sensor.c index aaf698a6cb27f..1c991a4caafc7 100644 --- a/ports/silabs/boards/devkit_xg24_brd2601b/sensor.c +++ b/ports/silabs/boards/devkit_xg24_brd2601b/sensor.c @@ -75,7 +75,7 @@ static mp_obj_t sensor_init(mp_obj_t i2c_in) { return mp_const_true; } -static mp_obj_t sensor_deinit() { +static mp_obj_t sensor_deinit(void) { sl_sensor_hall_deinit(); sl_sensor_lux_deinit(); diff --git a/ports/silabs/common-hal/_bleio/CharacteristicBuffer.c b/ports/silabs/common-hal/_bleio/CharacteristicBuffer.c index d6a64db3a2e95..d08fa765c4f71 100644 --- a/ports/silabs/common-hal/_bleio/CharacteristicBuffer.c +++ b/ports/silabs/common-hal/_bleio/CharacteristicBuffer.c @@ -156,7 +156,7 @@ bool common_hal_bleio_characteristic_buffer_connected( common_hal_bleio_connection_get_connected(self->characteristic->service->connection))); } -void reset_characteristic_buffer_list() { +void reset_characteristic_buffer_list(void) { // Remove characteristic_buffer list memset(bleio_characteristic_buffer_list.data, 0, sizeof(bleio_characteristic_buffer_list.data)); diff --git a/ports/silabs/common-hal/_bleio/PacketBuffer.c b/ports/silabs/common-hal/_bleio/PacketBuffer.c index 1d2b140f7efef..dec833fe62f85 100644 --- a/ports/silabs/common-hal/_bleio/PacketBuffer.c +++ b/ports/silabs/common-hal/_bleio/PacketBuffer.c @@ -391,7 +391,7 @@ void common_hal_bleio_packet_buffer_deinit(bleio_packet_buffer_obj_t *self) { } // Remove packet_buffer list when reload -void reset_packet_buffer_list() { +void reset_packet_buffer_list(void) { // Remove packet_buffer list memset(bleio_packet_buffer_list.data, 0, sizeof(bleio_packet_buffer_list.data)); diff --git a/ports/silabs/common-hal/_bleio/Service.c b/ports/silabs/common-hal/_bleio/Service.c index 694841e66284f..abc8ffe74edff 100644 --- a/ports/silabs/common-hal/_bleio/Service.c +++ b/ports/silabs/common-hal/_bleio/Service.c @@ -230,7 +230,7 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, } // Remove dynamic service when reload -void reset_dynamic_service() { +void reset_dynamic_service(void) { uint16_t gattdb_session; uint8_t svc_index; diff --git a/ports/silabs/common-hal/_bleio/__init__.c b/ports/silabs/common-hal/_bleio/__init__.c index a9ad7b32c36ba..c6ae8a0b606c8 100644 --- a/ports/silabs/common-hal/_bleio/__init__.c +++ b/ports/silabs/common-hal/_bleio/__init__.c @@ -54,7 +54,7 @@ const osMutexAttr_t bluetooth_connection_mutex_attr = { void common_hal_bleio_init(void) { } -void bleio_user_reset() { +void bleio_user_reset(void) { // Stop any user scanning or advertising. common_hal_bleio_adapter_stop_scan(&common_hal_bleio_adapter_obj); common_hal_bleio_adapter_stop_advertising(&common_hal_bleio_adapter_obj); @@ -63,7 +63,7 @@ void bleio_user_reset() { supervisor_bluetooth_background(); } -void bleio_reset() { +void bleio_reset(void) { reset_dynamic_service(); reset_packet_buffer_list(); reset_characteristic_buffer_list(); diff --git a/ports/stm/Makefile b/ports/stm/Makefile index baea6893a33d9..9db283767e0ec 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -51,7 +51,7 @@ CFLAGS += -ftree-vrp # STM32 MCU series must be defined. See supervisor/linker.h C_DEFS = -D$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(MCU_VARIANT) -DSTM32$(MCU_SERIES) -CFLAGS += $(INC) -Werror -Wall -std=gnu11 -fshort-enums $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -nostdlib -nostartfiles +CFLAGS += $(INC) -Werror -Wall -std=gnu11 -fshort-enums $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -nostdlib -nostartfiles -Werror=old-style-definition # Undo some warnings. # STM32 HAL uses undefined preprocessor variables, shadowed variables, casts that change alignment reqs diff --git a/ports/stm/common-hal/sdioio/SDCard.c b/ports/stm/common-hal/sdioio/SDCard.c index a5c8b0404a0fb..92e552c2e8984 100644 --- a/ports/stm/common-hal/sdioio/SDCard.c +++ b/ports/stm/common-hal/sdioio/SDCard.c @@ -338,7 +338,7 @@ void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self) { } } -void sdioio_reset() { +void sdioio_reset(void) { for (size_t i = 0; i < MP_ARRAY_SIZE(reserved_sdio); i++) { if (!never_reset_sdio[i]) { reserved_sdio[i] = false; diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 4aa8c044122ce..c5a1685a7fddc 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -285,7 +285,7 @@ void HAL_Delay(uint32_t delay_ms) { } } -uint32_t HAL_GetTick() { +uint32_t HAL_GetTick(void) { if (SysTick->CTRL != 0) { return systick_ms; } else { diff --git a/shared-module/usb_cdc/__init__.c b/shared-module/usb_cdc/__init__.c index 0248c0f180fdb..9a9f158f28cfb 100644 --- a/shared-module/usb_cdc/__init__.c +++ b/shared-module/usb_cdc/__init__.c @@ -356,10 +356,10 @@ size_t usb_vendor_descriptor_length(void) { static uint8_t *ms_os_20_descriptor = NULL; -size_t vendor_ms_os_20_descriptor_length() { +size_t vendor_ms_os_20_descriptor_length(void) { return ms_os_20_descriptor != NULL ? sizeof(ms_os_20_descriptor_template) : 0; } -uint8_t const *vendor_ms_os_20_descriptor() { +uint8_t const *vendor_ms_os_20_descriptor(void) { return ms_os_20_descriptor; }