From: "Yann E. MORIN" <[email protected]>
Michal,
Please pull this fix to restore compilation of the qconf frontend.
Regards,
Yann E. MORIN.
The following changes since commit 23a5dfdad22a574d19d7cc19b391f9ce0d3c2f21:
Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG" (2013-04-26 23:21:59 +0200)
are available in the git repository at:
git://gitorious.org/linux-kconfig/linux-kconfig.git yem-kconfig-for-next
for you to fetch changes up to 21ca352b71ca252e1933b1538fe89da8a04395c3:
kconfig: fix lists definition for C++ (2013-04-29 19:55:56 +0200)
----------------------------------------------------------------
Yann E. MORIN (1):
kconfig: fix lists definition for C++
scripts/kconfig/list.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
From: "Yann E. MORIN" <[email protected]>
The C++ compiler is more strict in that it refuses to assign
a void* to a struct list_head*.
Fix that by explicitly casting the poisonning constants.
(Tested with all 5 frontends, now.)
Reported-by: Randy Dunlap <[email protected]>
Signed-off-by: "Yann E. MORIN" <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Benjamin Poirier <[email protected]>
---
scripts/kconfig/list.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/kconfig/list.h b/scripts/kconfig/list.h
index ea1d581..685d80e 100644
--- a/scripts/kconfig/list.h
+++ b/scripts/kconfig/list.h
@@ -125,7 +125,7 @@ static inline void __list_del(struct list_head *prev, struct list_head *next)
static inline void list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
- entry->next = LIST_POISON1;
- entry->prev = LIST_POISON2;
+ entry->next = (struct list_head*)LIST_POISON1;
+ entry->prev = (struct list_head*)LIST_POISON2;
}
#endif
--
1.8.1.2
On 04/29/13 10:59, Yann E. MORIN wrote:
> From: "Yann E. MORIN" <[email protected]>
>
> The C++ compiler is more strict in that it refuses to assign
> a void* to a struct list_head*.
>
> Fix that by explicitly casting the poisonning constants.
>
> (Tested with all 5 frontends, now.)
>
> Reported-by: Randy Dunlap <[email protected]>
> Signed-off-by: "Yann E. MORIN" <[email protected]>
> Cc: Randy Dunlap <[email protected]>
> Cc: Benjamin Poirier <[email protected]>
Acked-by: Randy Dunlap <[email protected]>
Thanks.
> ---
> scripts/kconfig/list.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/kconfig/list.h b/scripts/kconfig/list.h
> index ea1d581..685d80e 100644
> --- a/scripts/kconfig/list.h
> +++ b/scripts/kconfig/list.h
> @@ -125,7 +125,7 @@ static inline void __list_del(struct list_head *prev, struct list_head *next)
> static inline void list_del(struct list_head *entry)
> {
> __list_del(entry->prev, entry->next);
> - entry->next = LIST_POISON1;
> - entry->prev = LIST_POISON2;
> + entry->next = (struct list_head*)LIST_POISON1;
> + entry->prev = (struct list_head*)LIST_POISON2;
> }
> #endif
>
--
~Randy
On 04/29/2013 02:28:07 PM, Randy Dunlap wrote:
> On 04/29/13 10:59, Yann E. MORIN wrote:
> > From: "Yann E. MORIN" <[email protected]>
> >
> > The C++ compiler is more strict in that it refuses to assign
> > a void* to a struct list_head*.
Given that the code _isn't_ C++ (because C is not a subset of C++ but a
separate langauge in its own right where "throw" is a legitimate
variable name and so on), how is this an issue?
Rob-
Rob, All,
On Mon, Apr 29, 2013 at 04:54:14PM -0500, Rob Landley wrote:
> On 04/29/2013 02:28:07 PM, Randy Dunlap wrote:
> >On 04/29/13 10:59, Yann E. MORIN wrote:
> >> From: "Yann E. MORIN" <[email protected]>
> >>
> >> The C++ compiler is more strict in that it refuses to assign
> >> a void* to a struct list_head*.
>
> Given that the code _isn't_ C++ (because C is not a subset of C++ but a
> separate langauge in its own right where "throw" is a legitimate variable
> name and so on), how is this an issue?
It's an issue because the xconfig frontends is qconf, which as the name
implies is using Qt, which *is* C++, and includes list.h.
So, list.h is included by both by C and C++ code.
So yes, list.h can be compiled by a C++ compiler.
Now, granted: list.h should all be enclosed in:
ifdef __cpluplus
extern "C" {
endif
...
ifdef __cpluplus
}
endif
Was that the fix you were suggesting between the lines? ;-)
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
On 04/29/2013 05:30:54 PM, Yann E. MORIN wrote:
> Rob, All,
>
> On Mon, Apr 29, 2013 at 04:54:14PM -0500, Rob Landley wrote:
> > On 04/29/2013 02:28:07 PM, Randy Dunlap wrote:
> > >On 04/29/13 10:59, Yann E. MORIN wrote:
> > >> From: "Yann E. MORIN" <[email protected]>
> > >>
> > >> The C++ compiler is more strict in that it refuses to assign
> > >> a void* to a struct list_head*.
> >
> > Given that the code _isn't_ C++ (because C is not a subset of C++
> but a
> > separate langauge in its own right where "throw" is a legitimate
> variable
> > name and so on), how is this an issue?
>
> It's an issue because the xconfig frontends is qconf, which as the
> name
> implies is using Qt, which *is* C++, and includes list.h.
>
> So, list.h is included by both by C and C++ code.
>
> So yes, list.h can be compiled by a C++ compiler.
>
> Now, granted: list.h should all be enclosed in:
> ifdef __cpluplus
> extern "C" {
> endif
> ...
> ifdef __cpluplus
> }
> endif
>
> Was that the fix you were suggesting between the lines? ;-)
It does more clearly document the issue. (A comment about the QT
front-end would also be nice. I don't use that one, so I didn't think
of it.)
Thanks,
Rob-
On 29.4.2013 19:59, Yann E. MORIN wrote:
> The following changes since commit 23a5dfdad22a574d19d7cc19b391f9ce0d3c2f21:
>
> Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG" (2013-04-26 23:21:59 +0200)
>
> are available in the git repository at:
>
> git://gitorious.org/linux-kconfig/linux-kconfig.git yem-kconfig-for-next
Pulled, thanks.
Michal