Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: adapt to gcc 14.2 #516

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions multi/grlib-multi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ LOCAL_SRCS := adc.c gpio.c spacewire.c spi.c uart.c grlib-multi.c
LOCAL_HEADERS := grlib-multi.h
DEP_LIBS := libtty libklog libpseudodev libgrdmac2

# FIXME: adapt code to array-bounds checker
LOCAL_CFLAGS := -Wno-array-bounds

include $(binary.mk)
5 changes: 5 additions & 0 deletions multi/grlib-multi/spacewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,11 @@ static int spw_configure(spw_dev_t *dev, const spw_config_t *config)

static void spw_handleDevCtl(msg_t *msg, int dev)
{
if ((dev < 0) || (dev >= (sizeof(spw_common.dev) / sizeof(spw_common.dev[0])))) {
msg->o.err = -ENODEV;
return;
}

const multi_i_t *idevctl = (multi_i_t *)msg->i.raw;
multi_o_t *odevctl = (multi_o_t *)msg->o.raw;
spw_dev_t *spw = &spw_common.dev[dev];
Expand Down
3 changes: 3 additions & 0 deletions multi/imxrt-multi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ DEP_LIBS := libtty libklog libpseudodev i2c-common
LIBS := libdummyfs libklog libpseudodev libposixsrv
LOCAL_HEADERS := imxrt-multi.h

# FIXME: adapt code to array-bounds checker
LOCAL_CFLAGS := -Wno-array-bounds

include $(binary.mk)
4 changes: 4 additions & 0 deletions multi/stm32l1-multi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
NAME := stm32l1-multi
LOCAL_SRCS = stm32l1-multi.c uart.c rcc.c gpio.c adc.c i2c.c lcd.c rtc.c flash.c spi.c exti.c dma.c
LOCAL_HEADERS := stm32l1-multi.h

# FIXME: adapt code to array-bounds checker
LOCAL_CFLAGS := -Wno-array-bounds

include $(binary.mk)
3 changes: 3 additions & 0 deletions multi/stm32l4-multi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ LOCAL_HEADERS := stm32l4-multi.h
DEP_LIBS := libstm32l4-multi libtty libklog
LIBS := libdummyfs libklog libposixsrv

# FIXME: adapt code to array-bounds checker
LOCAL_CFLAGS := -Wno-array-bounds

include $(binary.mk)
4 changes: 2 additions & 2 deletions sensors/libsensors-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int sensorsspi_open(const char *devSPI, const char *devSS, oid_t *spi, oid_t *ss

/* Configure pin as output */
dir = dirname(path);
sprintf(dir, "%s/dir", dir);
strcat(dir, "/dir");

ntries = 10;
while (lookup(dir, NULL, &oid) < 0) {
Expand All @@ -127,7 +127,7 @@ int sensorsspi_open(const char *devSPI, const char *devSS, oid_t *spi, oid_t *ss

/* Raise SS pin high */
dir = dirname(path);
sprintf(dir, "%s/port", dir);
strcat(dir, "/port");

ntries = 10;
while (lookup(dir, NULL, &oid) < 0) {
Expand Down
4 changes: 2 additions & 2 deletions storage/zynq7000-flash/qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static int qspi_setPin(uint32_t pin)

static int qspi_initPins(void)
{
int res, i;
int res = EOK;
static const int pins[] = {
QSPI_CS,
QSPI_IO0,
Expand All @@ -416,7 +416,7 @@ static int qspi_initPins(void)
QSPI_FCLK
};

for (i = 0; i < sizeof(pins) / sizeof(pins[0]); ++i) {
for (size_t i = 0; i < (sizeof(pins) / sizeof(pins[0])); ++i) {
/* Pin should not be configured by the driver */
if (pins[i] < 0) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion tty/zynq7000-uart/zynq7000-uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static void uart_klogClbk(const char *data, size_t size)

static void uart_mkDev(unsigned int id)
{
char path[12];
char path[20];

snprintf(path, sizeof(path), "/dev/uart%u", id);
if (create_dev(&uart_common.uart.oid, path) < 0) {
Expand Down
Loading