Do not compare pointer to int

Message ID 000c01d3a181$f32ca9c0$d985fd40$@jasoon.nl
State New
Headers show
Series
  • Do not compare pointer to int
Related show

Commit Message

Jaap de Wolff Feb. 9, 2018, 8:42 a.m.
In syscalls was a pointer to int comparison

Jaap de Wolff

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

Comments

Corinna Vinschen Feb. 9, 2018, 6:21 p.m. | #1
On Feb  9 09:42, Jaap de Wolff wrote:
> In syscalls was a pointer to int comparison

> 

> Jaap de Wolff

> 

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

> index 5548dcfb3..51d2bedde 100644

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

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

> @@ -718,7 +718,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.  */

> 


This patch has a line break problem (git format-patch/git send-email
should fix this)


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Patch

diff --git a/libgloss/arm/syscalls.c b/libgloss/arm/syscalls.c
index 5548dcfb3..51d2bedde 100644
--- a/libgloss/arm/syscalls.c
+++ b/libgloss/arm/syscalls.c
@@ -718,7 +718,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