diff mbox series

[Aarch64] Fix warning in _sbrk

Message ID CAKdteOa_tGNn7O+EZ+NweHsXuD_zg-JQuRRDsTbx3r4H_u9r8Q@mail.gmail.com
State Accepted
Commit 9edf0810db87603fc5c71db20ffc5b955c9adc42
Headers show
Series [Aarch64] Fix warning in _sbrk | expand

Commit Message

Christophe Lyon Oct. 1, 2018, 9:34 p.m. UTC
Hi,

While building newlib for Aarch64, I noticed a warning in _sbrk. This
small patch fixes it the same way it is done in the Arm version.

OK?

Christophe
commit 828bf40d0d822425cbfb0cd69dbb4e48cca66592
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date:   Mon Oct 1 19:08:40 2018 +0000

    [Aarch64] Fix warning in _sbrk
    
    2018-10-01  Christophe Lyon  <christophe.lyon@linaro.org>
    
    	* libgloss/aarch64/syscalls.c (_sbrk): Cast "__heap_limit" to
    	"char *".

Comments

Christophe Lyon Oct. 5, 2018, 9:19 a.m. UTC | #1
ping?
On Mon, 1 Oct 2018 at 23:34, Christophe Lyon <christophe.lyon@linaro.org> wrote:
>

> Hi,

>

> While building newlib for Aarch64, I noticed a warning in _sbrk. This

> small patch fixes it the same way it is done in the Arm version.

>

> OK?

>

> Christophe
Richard Earnshaw (lists) Oct. 5, 2018, 12:22 p.m. UTC | #2
On 01/10/18 22:34, Christophe Lyon wrote:
> Hi,

> 

> While building newlib for Aarch64, I noticed a warning in _sbrk. This

> small patch fixes it the same way it is done in the Arm version.

> 

> OK?

> 

Pushed.

R.

> Christophe

> 

> 

> newlib-5.txt

> 

> 

> commit 828bf40d0d822425cbfb0cd69dbb4e48cca66592

> Author: Christophe Lyon <christophe.lyon@linaro.org>

> Date:   Mon Oct 1 19:08:40 2018 +0000

> 

>     [Aarch64] Fix warning in _sbrk

>     

>     2018-10-01  Christophe Lyon  <christophe.lyon@linaro.org>

>     

>     	* libgloss/aarch64/syscalls.c (_sbrk): Cast "__heap_limit" to

>     	"char *".

> 

> diff --git a/libgloss/aarch64/syscalls.c b/libgloss/aarch64/syscalls.c

> index 8198d3e..e6dd4bd 100644

> --- a/libgloss/aarch64/syscalls.c

> +++ b/libgloss/aarch64/syscalls.c

> @@ -642,7 +642,7 @@ _sbrk (int incr)

>  

>    if ((heap_end + incr > stack_ptr)

>        /* Honour heap limit if it's valid.  */

> -      || ((__heap_limit != 0xcafedead) && (heap_end + incr > __heap_limit)))

> +      || ((__heap_limit != 0xcafedead) && (heap_end + incr > (char *)__heap_limit)))

>      {

>        /* Some of the libstdc++-v3 tests rely upon detecting

>           out of memory errors, so do not abort here.  */

>
diff mbox series

Patch

diff --git a/libgloss/aarch64/syscalls.c b/libgloss/aarch64/syscalls.c
index 8198d3e..e6dd4bd 100644
--- a/libgloss/aarch64/syscalls.c
+++ b/libgloss/aarch64/syscalls.c
@@ -642,7 +642,7 @@  _sbrk (int incr)
 
   if ((heap_end + incr > stack_ptr)
       /* Honour heap limit if it's valid.  */
-      || ((__heap_limit != 0xcafedead) && (heap_end + incr > __heap_limit)))
+      || ((__heap_limit != 0xcafedead) && (heap_end + incr > (char *)__heap_limit)))
     {
       /* Some of the libstdc++-v3 tests rely upon detecting
          out of memory errors, so do not abort here.  */