-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
gcc correctly warns about a couple of dodgy casts when building Apex with -Wcast-qual.
In file included from /home/patrick/src/motec/adr2/apex/sys/include/arch.h:39,
from /home/patrick/src/motec/adr2/apex/sys/kern/syslog.c:8:
/home/patrick/src/motec/adr2/apex/sys/kern/syslog.c: In function 'syslog_output':
/home/patrick/src/motec/adr2/apex/sys/include/compiler.h:108:4: warning: to be safe all intermediate pointers in cast from 'void (**)(void)' to 'void (* volatile*)(void)' must be 'const' qualified [-Wcast-qual]
108 | *(volatile typeof(*(p)) *)(p) = v; \
| ^
/home/patrick/src/motec/adr2/apex/sys/kern/syslog.c:276:2: note: in expansion of macro 'write_once'
276 | write_once(&log_output, fn);
| ^~~~~~~~~~
/home/patrick/src/motec/adr2/apex/sys/arch/arm/v7m/context.c: In function 'fpu_load':
/home/patrick/src/motec/adr2/apex/sys/arch/arm/v7m/context.c:329:12: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual]
329 | : : "m"(*(const uint32_t(*)[16])(f->regs + 16)), "r"(f->regs + 16));
| ^
Metadata
Metadata
Assignees
Labels
No labels