From 9da0ac405163466bafc404e2335ae7f23309c311 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Sun, 17 Nov 2024 04:31:42 +0100 Subject: [PATCH] libgloss: cris: Correct lcrt0.c for C23 GCC commit r15-5326-gf242f79b8afe defaults to -std=gnu23, and in C23 void foo() means void foo(void), so old-style prototypes now get a compilation error: /x/libgloss/cris/lcrt0.c:107:1: error: conflicting types for 'start1';\ have 'void(int, char **, char **)' 107 | start1 (int argc, char **argv, char **env) | ^~~~~~ /x/libgloss/cris/lcrt0.c:105:13: note: previous declaration of 'start1\ ' with type 'void(void)' 105 | static void start1 () __asm__ ("__start1") __attribute ((__use\ d__)); Fix by providing a full prototype. --- libgloss/cris/lcrt0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgloss/cris/lcrt0.c b/libgloss/cris/lcrt0.c index 0aae3c279..c1406155a 100644 --- a/libgloss/cris/lcrt0.c +++ b/libgloss/cris/lcrt0.c @@ -1,5 +1,5 @@ /* Support for cris*-axis-linux-gnu and src/sim/cris simulator. - Copyright (C) 2000-2005, 2017, 2023 Axis Communications. + Copyright (C) 2000-2005, 2017, 2023, 2024 Axis Communications. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -102,7 +102,7 @@ extern void __init__start (void) __attribute ((weak)); extern void __aout__ctors (void) __attribute ((weak)); extern int main (int argc, char **argv, char **env); -static void start1 () __asm__ ("__start1") __attribute ((__used__)); +static void start1 (int, char **, char **) __asm__ ("__start1") __attribute ((__used__)); static void start1 (int argc, char **argv, char **env) {