[0/2] libgloss: Fix build warnings for RISC-V

Message ID 20251201143333.513005-1-pincheng.plct@isrc.iscas.ac.cn
Headers
Series libgloss: Fix build warnings for RISC-V |

Message

Pincheng Wang Dec. 1, 2025, 2:33 p.m. UTC
  Hi all,

This patch series addresses build warnings encountered when compiling
libgloss for RISC-V using gcc version 15.1.0 (g1b306039ac4) and
configure command './configure --target=riscv64-unknown
-elf --prefix=/opt/newlib-sysroot-rv64'.

Newer GCC versions are stricter regarding function declarations and type
definitions.

Patch 1 converts old-style K&R function definitions to ANSI C prototypes
in sbrk implementations.
Patch 2 adds missing includes to sys_utime.c to ensure 'struct utimbuf'
is properly defined.

I would appreciate any feedback and comments.

Thanks,
Pincheng Wang

Pincheng Wang (2):
  libgloss/riscv: Fix old style function declaration warnings
  libgloss/riscv: Fix struct utimbuf warning in sys_utime.c stub

 libgloss/libnosys/sbrk.c           | 3 +--
 libgloss/riscv/semihost-sys_sbrk.c | 3 +--
 libgloss/riscv/sys_sbrk.c          | 3 +--
 libgloss/riscv/sys_utime.c         | 2 ++
 4 files changed, 5 insertions(+), 6 deletions(-)
  

Comments

Kito Cheng Dec. 1, 2025, 2:54 p.m. UTC | #1
Thanks for the patch, I've pushed to trunk :)

On Mon, Dec 1, 2025 at 10:35 PM Pincheng Wang
<pincheng.plct@isrc.iscas.ac.cn> wrote:
>
> Hi all,
>
> This patch series addresses build warnings encountered when compiling
> libgloss for RISC-V using gcc version 15.1.0 (g1b306039ac4) and
> configure command './configure --target=riscv64-unknown
> -elf --prefix=/opt/newlib-sysroot-rv64'.
>
> Newer GCC versions are stricter regarding function declarations and type
> definitions.
>
> Patch 1 converts old-style K&R function definitions to ANSI C prototypes
> in sbrk implementations.
> Patch 2 adds missing includes to sys_utime.c to ensure 'struct utimbuf'
> is properly defined.
>
> I would appreciate any feedback and comments.
>
> Thanks,
> Pincheng Wang
>
> Pincheng Wang (2):
>   libgloss/riscv: Fix old style function declaration warnings
>   libgloss/riscv: Fix struct utimbuf warning in sys_utime.c stub
>
>  libgloss/libnosys/sbrk.c           | 3 +--
>  libgloss/riscv/semihost-sys_sbrk.c | 3 +--
>  libgloss/riscv/sys_sbrk.c          | 3 +--
>  libgloss/riscv/sys_utime.c         | 2 ++
>  4 files changed, 5 insertions(+), 6 deletions(-)
>
> --
> 2.39.5
>