Skip to content

Commit

Permalink
[make] add -Wstrict-prototypes and clean up old C style prototypes
Browse files Browse the repository at this point in the history
replace all built versions of foo(); with foo(void);

(cherry picked from commit 7643bc28c3a99108a85828f1796f1bc3b07ddde5)
[backport to old Qualcomm LK]
  • Loading branch information
travisg authored and stephan-gh committed Aug 13, 2022
1 parent b611c76 commit f57ccb6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion arch/arm/include/arch/arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ extern "C" {

void arm_context_switch(vaddr_t *old_sp, vaddr_t new_sp);

static inline uint32_t read_cpsr() {
static inline uint32_t read_cpsr(void)
{
uint32_t cpsr;

__asm__ volatile("mrs %0, cpsr" : "=r" (cpsr));
Expand Down
2 changes: 1 addition & 1 deletion kernel/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static void call_constructors(void)
while(ctor != &__ctor_end) {
void (*func)(void);

func = (void (*)())*ctor;
func = (void (*)(void))*ctor;

func();
ctor++;
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ endif

INCLUDES := -I$(BUILDDIR) -Iinclude
CFLAGS := -O2 -g -finline -W -Wall -Wno-multichar -Wno-unused-parameter -Wno-unused-function $(LKLE_CFLAGS) -include $(CONFIGHEADER)
CFLAGS += -fno-common
CFLAGS += -fno-common -Wstrict-prototypes
#CFLAGS += -Werror

ifeq ($(SIGNED_KERNEL),1)
Expand Down
2 changes: 1 addition & 1 deletion platform/armemu/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void debug_set_trace_level(int trace_type, int level)
*REG32(DEBUG_SET_TRACELEVEL_CPU + trace_type * 4) = level;
}

uint32_t debug_cycle_count()
uint32_t debug_cycle_count(void)
{
return *REG32(DEBUG_CYCLE_COUNT);
}

0 comments on commit f57ccb6

Please sign in to comment.