qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] ncurses 5.3 conflicts with latest qemu
@ 2011-11-17  9:06 ` Caraman Mihai Claudiu-B02008
  2011-12-05 19:13   ` andrzej zaborowski
  0 siblings, 1 reply; 4+ messages in thread
From: Caraman Mihai Claudiu-B02008 @ 2011-11-17  9:06 UTC (permalink / raw)
  To: qemu-devel@nongnu.org

Hi,

A recent patch in qemu conflicts with old ncurses libraries (version 5.3). You will see this error cause by bool type redefinition in curses.h (with CONFIG_CURSES configured by default):

console.c: In function 'text_console_init':
console.c:1550:23: error: assignment from incompatible pointer type

the qemu patch exposing this problem is:

curses: fix garbling when chtype != long
author	Devin J. Pohly <djpohly+launchpad@gmail.com>	
	Wed, 7 Sep 2011 19:44:36 +0000 (15:44 -0400)
committer	Anthony Liguori <aliguori@us.ibm.com>	
	Fri, 9 Sep 2011 17:58:16 +0000 (12:58 -0500)
commit	df00bed0fa30a6f5712456e7add783e470c534c9

The problem seems to be fixed in newer versions of ncurses (5.7 and above). I just looked over the sources, so better if someone can confirm this. 
Here is a qemu patch that solve the conflict with old ncurses:


Signed-off-by: Mihai Caraman <address@hidden>
---
Fix compile errors with old ncurses libraries (version 5.3) caused by bool type redefinition.

 qemu-common.h |    3 +++
 console.h     |    1 -

 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/qemu-common.h b/qemu-common.h index 5e87bdf..9ac15ba 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -23,6 +23,9 @@ typedef struct Monitor Monitor;  #include <stdlib.h>  #include <stdio.h>  #include <stdarg.h>
+#ifdef CONFIG_CURSES
+#include <curses.h>
+#endif
 #include <stdbool.h>
 #include <string.h>
 #include <strings.h>
diff --git a/console.h b/console.h
index 9c1487e..3327c43 100644
--- a/console.h
+++ b/console.h
@@ -329,7 +329,6 @@ static inline int ds_get_bytes_per_pixel(DisplayState *ds)  }
 
 #ifdef CONFIG_CURSES
-#include <curses.h>
 typedef chtype console_ch_t;
 #else
 typedef unsigned long console_ch_t;
--
1.7.4.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] ncurses 5.3 conflicts with latest qemu
  2011-11-17  9:06 ` [Qemu-devel] ncurses 5.3 conflicts with latest qemu Caraman Mihai Claudiu-B02008
@ 2011-12-05 19:13   ` andrzej zaborowski
  2011-12-05 21:44     ` Stefan Weil
  0 siblings, 1 reply; 4+ messages in thread
From: andrzej zaborowski @ 2011-12-05 19:13 UTC (permalink / raw)
  To: Caraman Mihai Claudiu-B02008; +Cc: qemu-devel@nongnu.org

Hi,

On 17 November 2011 10:06, Caraman Mihai Claudiu-B02008
<B02008@freescale.com> wrote:
> A recent patch in qemu conflicts with old ncurses libraries (version 5.3). You will see this error cause by bool type redefinition in curses.h (with CONFIG_CURSES configured by default):
>
> console.c: In function 'text_console_init':
> console.c:1550:23: error: assignment from incompatible pointer type
>
> the qemu patch exposing this problem is:
>
> curses: fix garbling when chtype != long
> author  Devin J. Pohly <djpohly+launchpad@gmail.com>
>        Wed, 7 Sep 2011 19:44:36 +0000 (15:44 -0400)
> committer       Anthony Liguori <aliguori@us.ibm.com>
>        Fri, 9 Sep 2011 17:58:16 +0000 (12:58 -0500)
> commit  df00bed0fa30a6f5712456e7add783e470c534c9
>
> The problem seems to be fixed in newer versions of ncurses (5.7 and above). I just looked over the sources, so better if someone can confirm this.
> Here is a qemu patch that solve the conflict with old ncurses:
>
>
> Signed-off-by: Mihai Caraman <address@hidden>
> ---
> Fix compile errors with old ncurses libraries (version 5.3) caused by bool type redefinition.
>
>  qemu-common.h |    3 +++
>  console.h     |    1 -
>
>  2 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/qemu-common.h b/qemu-common.h index 5e87bdf..9ac15ba 100644
> --- a/qemu-common.h
> +++ b/qemu-common.h
> @@ -23,6 +23,9 @@ typedef struct Monitor Monitor;  #include <stdlib.h>  #include <stdio.h>  #include <stdarg.h>
> +#ifdef CONFIG_CURSES
> +#include <curses.h>
> +#endif
>  #include <stdbool.h>
>  #include <string.h>
>  #include <strings.h>
> diff --git a/console.h b/console.h
> index 9c1487e..3327c43 100644
> --- a/console.h
> +++ b/console.h
> @@ -329,7 +329,6 @@ static inline int ds_get_bytes_per_pixel(DisplayState *ds)  }
>
>  #ifdef CONFIG_CURSES
> -#include <curses.h>
>  typedef chtype console_ch_t;
>  #else
>  typedef unsigned long console_ch_t;

While very fragile it looks like the easiest fix, so I'd like to push
this if there's no objection.  It builds fine for me.

The solution would probably be to include <curses.h> only from inside
ui/curses.c, and define chtype at configure time, or guess it.

Cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] ncurses 5.3 conflicts with latest qemu
  2011-12-05 19:13   ` andrzej zaborowski
@ 2011-12-05 21:44     ` Stefan Weil
  2011-12-07 18:01       ` andrzej zaborowski
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Weil @ 2011-12-05 21:44 UTC (permalink / raw)
  To: andrzej zaborowski; +Cc: Caraman Mihai Claudiu-B02008, qemu-devel@nongnu.org

Am 05.12.2011 20:13, schrieb andrzej zaborowski:
> Hi,
>
> On 17 November 2011 10:06, Caraman Mihai Claudiu-B02008
> <B02008@freescale.com> wrote:
>> A recent patch in qemu conflicts with old ncurses libraries (version 
>> 5.3). You will see this error cause by bool type redefinition in 
>> curses.h (with CONFIG_CURSES configured by default):
>>
>> console.c: In function 'text_console_init':
>> console.c:1550:23: error: assignment from incompatible pointer type
>>
>> the qemu patch exposing this problem is:
>>
>> curses: fix garbling when chtype != long
>> author  Devin J. Pohly <djpohly+launchpad@gmail.com>
>>        Wed, 7 Sep 2011 19:44:36 +0000 (15:44 -0400)
>> committer       Anthony Liguori <aliguori@us.ibm.com>
>>        Fri, 9 Sep 2011 17:58:16 +0000 (12:58 -0500)
>> commit  df00bed0fa30a6f5712456e7add783e470c534c9
>>
>> The problem seems to be fixed in newer versions of ncurses (5.7 and 
>> above). I just looked over the sources, so better if someone can 
>> confirm this.
>> Here is a qemu patch that solve the conflict with old ncurses:
>>
>>
>> Signed-off-by: Mihai Caraman <address@hidden>
>> ---
>> Fix compile errors with old ncurses libraries (version 5.3) caused by 
>> bool type redefinition.
>>
>>  qemu-common.h |    3 +++
>>  console.h     |    1 -
>>
>>  2 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/qemu-common.h b/qemu-common.h index 5e87bdf..9ac15ba 100644
>> --- a/qemu-common.h
>> +++ b/qemu-common.h
>> @@ -23,6 +23,9 @@ typedef struct Monitor Monitor;  #include 
>> <stdlib.h>  #include <stdio.h>  #include <stdarg.h>
>> +#ifdef CONFIG_CURSES
>> +#include <curses.h>
>> +#endif
>>  #include <stdbool.h>
>>  #include <string.h>
>>  #include <strings.h>
>> diff --git a/console.h b/console.h
>> index 9c1487e..3327c43 100644
>> --- a/console.h
>> +++ b/console.h
>> @@ -329,7 +329,6 @@ static inline int 
>> ds_get_bytes_per_pixel(DisplayState *ds)  }
>>
>>  #ifdef CONFIG_CURSES
>> -#include <curses.h>
>>  typedef chtype console_ch_t;
>>  #else
>>  typedef unsigned long console_ch_t;
>
> While very fragile it looks like the easiest fix, so I'd like to push
> this if there's no objection. It builds fine for me.
>
> The solution would probably be to include <curses.h> only from inside
> ui/curses.c, and define chtype at configure time, or guess it.
>
> Cheers

Even Debian Lenny already has ncurses 5.7 and does not
need this patch.

Is there a good reason why very old buggy versions of ncurses
should be supported? Redefining bool is a bug!

When I had the same problem some time ago, I fixed my local
installation...

Adding include files to qemu-common.h adds a little compile time
for a lot of files, therefore I'd not do it here.

If you choose to do it nevertheless, a comment in the source
which explains the reason for curses.h would be good.

Cheers,

Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] ncurses 5.3 conflicts with latest qemu
  2011-12-05 21:44     ` Stefan Weil
@ 2011-12-07 18:01       ` andrzej zaborowski
  0 siblings, 0 replies; 4+ messages in thread
From: andrzej zaborowski @ 2011-12-07 18:01 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Caraman Mihai Claudiu-B02008, qemu-devel@nongnu.org

On 5 December 2011 22:44, Stefan Weil <sw@weilnetz.de> wrote:
> Am 05.12.2011 20:13, schrieb andrzej zaborowski:
>
>> Hi,
>>
>> On 17 November 2011 10:06, Caraman Mihai Claudiu-B02008
>> <B02008@freescale.com> wrote:
>>>
>>> A recent patch in qemu conflicts with old ncurses libraries (version
>>> 5.3). You will see this error cause by bool type redefinition in curses.h
>>> (with CONFIG_CURSES configured by default):
>>>
>>> console.c: In function 'text_console_init':
>>> console.c:1550:23: error: assignment from incompatible pointer type
>>>
>>> the qemu patch exposing this problem is:
>>>
>>> curses: fix garbling when chtype != long
>>> author  Devin J. Pohly <djpohly+launchpad@gmail.com>
>>>       Wed, 7 Sep 2011 19:44:36 +0000 (15:44 -0400)
>>> committer       Anthony Liguori <aliguori@us.ibm.com>
>>>       Fri, 9 Sep 2011 17:58:16 +0000 (12:58 -0500)
>>> commit  df00bed0fa30a6f5712456e7add783e470c534c9
>>>
>>> The problem seems to be fixed in newer versions of ncurses (5.7 and
>>> above). I just looked over the sources, so better if someone can confirm
>>> this.
>>> Here is a qemu patch that solve the conflict with old ncurses:
>>>
>>>
>>> Signed-off-by: Mihai Caraman <address@hidden>
>>> ---
>>> Fix compile errors with old ncurses libraries (version 5.3) caused by
>>> bool type redefinition.
>>>
>>>  qemu-common.h |    3 +++
>>>  console.h     |    1 -
>>>
>>>  2 files changed, 3 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/qemu-common.h b/qemu-common.h index 5e87bdf..9ac15ba 100644
>>> --- a/qemu-common.h
>>> +++ b/qemu-common.h
>>> @@ -23,6 +23,9 @@ typedef struct Monitor Monitor;  #include <stdlib.h>
>>>  #include <stdio.h>  #include <stdarg.h>
>>> +#ifdef CONFIG_CURSES
>>> +#include <curses.h>
>>> +#endif
>>>  #include <stdbool.h>
>>>  #include <string.h>
>>>  #include <strings.h>
>>> diff --git a/console.h b/console.h
>>> index 9c1487e..3327c43 100644
>>> --- a/console.h
>>> +++ b/console.h
>>> @@ -329,7 +329,6 @@ static inline int ds_get_bytes_per_pixel(DisplayState
>>> *ds)  }
>>>
>>>  #ifdef CONFIG_CURSES
>>> -#include <curses.h>
>>>  typedef chtype console_ch_t;
>>>  #else
>>>  typedef unsigned long console_ch_t;
>>
>>
>> While very fragile it looks like the easiest fix, so I'd like to push
>> this if there's no objection. It builds fine for me.
>>
>> The solution would probably be to include <curses.h> only from inside
>> ui/curses.c, and define chtype at configure time, or guess it.
>>
>> Cheers
>
>
> Even Debian Lenny already has ncurses 5.7 and does not
> need this patch.
>
> Is there a good reason why very old buggy versions of ncurses
> should be supported? Redefining bool is a bug!
>
> When I had the same problem some time ago, I fixed my local
> installation...

Makes sense.  Turns out that 5.3 was released in 2002 and from the
changelog it looks like the problem was fixed on 2004-01-17 or
earlier.  I'll send a patch for configure to refuse ncurses versions
older than that.

Cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-07 18:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <AcylCB+qRRBA0IiaSX2zjCyeqKQTfA==>
2011-11-17  9:06 ` [Qemu-devel] ncurses 5.3 conflicts with latest qemu Caraman Mihai Claudiu-B02008
2011-12-05 19:13   ` andrzej zaborowski
2011-12-05 21:44     ` Stefan Weil
2011-12-07 18:01       ` andrzej zaborowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).