[PATCH v2] libgloss: Resolve compilation errors for mips.

Corinna Vinschen vinschen@redhat.com
Tue Feb 18 17:24:49 GMT 2025


Hi Roger,

On Feb 18 14:06, Roger Sayle wrote:
> Hi Corinna,
> As requested here's the same patch as generated by "git format-patch -1 HEAD"
> instead of the previous "git diff" format patch.  p.s. either format can be applied
> to a clean source tree using the command "patch -p1 < filename.patch".

I'm aware of that, but newlib-cygwin is a git repo since 2016.

Not using git-formatted patches moves the onus for correct author
information as well as correct content of the commit message from the
author to the commiter.

So I hope it's ok to request git-formated patches.  A detailed commit
message doesn't hurt either.

> [...]
> --- a/libgloss/mips/cfe_mem.c
> +++ b/libgloss/mips/cfe_mem.c
> @@ -47,7 +47,7 @@ void *get_mem_info (struct s_mem *);
>  extern char _end[];
>  
>  /* Address immediately after available memory.  */
> -static unsigned long memtop;
> +static void *memtop;
>  
>  /* Program stack size.  */
>  static unsigned long stack_size;

Shouldn't this be changed to size_t?

> @@ -107,7 +107,7 @@ __libcfe_meminit (void)
>  
>    /* Chop the top of memory to a 32-byte aligned location, and
>       round the stack size up to a 32-byte multiple.  */
> -  memtop = memtop & ~(unsigned long)31;
> +  memtop = (void*)((unsigned long)memtop & ~(unsigned long)31);

Shouldn't unsigned long be changed to uintptr_t here, too?

>    stack_size = (stack_size + 31) & ~(unsigned long)31;

And size_t here?


Thanks,
Corinna



More information about the Newlib mailing list